How to get latest values for each group with an Elasticsearch query?

You can use a top_hits aggregation that groups on the country field, returns 1 doc per group, and orders the docs by the collected date descending: POST /test/_search?search_type=count { “aggs”: { “group”: { “terms”: { “field”: “country” }, “aggs”: { “group_docs”: { “top_hits”: { “size”: 1, “sort”: [ { “collected”: { “order”: “desc” } } … Read more

FIELDDATA Data is too large

You can try to increase the fielddata circuit breaker limit to 75% (default is 60%) in your elasticsearch.yml config file and restart your cluster: indices.breaker.fielddata.limit: 75% Or if you prefer to not restart your cluster you can change the setting dynamically using: curl -XPUT localhost:9200/_cluster/settings -d ‘{ “persistent” : { “indices.breaker.fielddata.limit” : “40%” } }’ … Read more

Elasticsearch vs Cassandra vs Elasticsearch with Cassandra

One of our applications uses data that is stored into both Cassandra and ElasticSearch. We use Cassandra to access those records whenever we can, and have data duplicated into query tables designed to adhere to specific application-side requests. For a more liberal search than our query tables can allow, ElasticSearch performs that functionality nicely. We … Read more

elasticsearch match vs term query

Assuming you are using the Standard Analyzer GET becomes get when stored in the index. The source document will still have the original “GET”. The match query will apply the same standard analyzer to the search term and will therefore match what is stored in the index. The term query does not apply any analyzers … Read more