AI Hints
Home›Elasticsearch Tutorial›Monitoring, Mistakes and OpenSearch
Elasticsearch · Lesson 113 of 120

Common Mistakes

Learn from others.

⏱ 2 min read▶ Video at 1:46:40🎓 Free
Watch this lesson in the Elasticsearch courseWatch on YouTube ↗Full Elasticsearch course

Most Elasticsearch problems come from the same handful of mistakes. Knowing them now saves you painful nights later.

  • Same mistakes
  • Every team
  • Avoid them

Mistakes and fixes

Relying on dynamic mapping in production. Using term on text fields. Paging deep with from and size. Creating thousands of tiny shards. And treating Elasticsearch as your only database. Each one has a simple fix.

MistakeFix
Dynamic mapping in prodexplicit mappings
term on text fieldsmatch, or .keyword
Deep from + sizesearch_after
Thousands of tiny shardsfewer, 10–50 GB each
Only copy of datasource of truth elsewhere

Three more

Don't refresh on every request. Don't let disks fill up. And don't put a cluster on the public internet, without security.

refresh=trueon every write
Full diskswatch watermarks
Open clusteralways secure it

Summary

Use explicit mappings, the right query types, search after, sensible shards, and keep a source of truth elsewhere. Next, Elasticsearch versus OpenSearch.

Key takeaways
  • Mappings
  • Shards
  • Source of truth
Next up: Elasticsearch vs OpenSearch — two close cousins