DEV Community

Discussion on: Elasticsearch(ES) and the hardships

Collapse
 
jillesvangurp profile image
Jilles van Gurp

The query DSL changed a lot since 1.7. The distinction between queries and filters is a bit more implicit. Mostly this is just about where you put what in the query. Filters are great for performance since there is no ranking involved and since ES has elaborate caching for filter results; which when you are doing aggregations of course matters.

Speaking of which, aggregations are a lot better behaved in later ES versions. It's still basic computer science in the sense that some things just are inherently not fast but it will at least prevent you from doing most things that would bring down your cluster. I'd say aggregations are a really good reason to use Elasticsearch. Most databases don't really have this type of features at all; or only have a tiny subset of features. Your only other option is doing funky stuff using some big data type asynchronous processing.

You need to figure out index management. Basically a good strategy is to reindex into a new index when your schema changes and use aliases to switch to a new index. Schemas in ES are not really mutable (other than adding stuff).