Questions tagged [elasticsearch-aggregation]

1111 questions
3
votes
1 answer

Elasticsearch Date Histogram aggregations results mismatch

I have taken the user count from the elastic search index. same query but different histogram interval types like Day, Month, Week, Quarter, and year the counts are not matching correctly note: totally I have only 4 months of data for this year This…
Samynathan
  • 51
  • 3
3
votes
1 answer

Order ElasticSearch results by percentage of nested field matches

I would like to order ElasticSearch query results based on the percentage of matches for a nested field. For example, let's suppose I have an ElasticSearch index strucutured as follows: { "properties": { "name": { "type":…
3
votes
3 answers

is there match phrase any query in elasticsearch?

In elasticsearch match_phrase query will match full phrase. match_phrase_prefix query will match phrase as prefix. for example: "my_field": "confidence ab" will match: "confidence above" and "confidence about". is there query for "match phrase…
V_R
  • 96
  • 9
3
votes
1 answer

Nested array of objects aggregation in Elasticsearch

Documents in the Elasticsearch are indexed as such Document 1 { "task_completed": 10 "tagged_object": [ { "category": "cat", "count": 10 }, { "category": "cars", "count": 20 } ] } Document 2 { …
user2250206
  • 76
  • 10
3
votes
1 answer

django-elasticsearch-dsl: how to add script to filter?

I have a 'MovieDoc' document and inside it a ListField called 'actors' that contains a list of ObjectFields with properties such as 'last_name', 'first_name', 'country,' etc. When running a query with Django ElasticSearch DSL, I would like to filter…
3
votes
0 answers

Elasticserch terms aggregation with partition does not honor the "size" value

I have a nested field in the ES index. I used the cardinality aggregation to get the total number of buckets and then came up with num_partitions, and size values to fetch the buckets. E.g. the total number of term buckets = 761 Used num_partitions…
User3518958
  • 676
  • 1
  • 6
  • 19
3
votes
1 answer

How can I flatten a deep aggregation in ElasticSearch?

I have documents in an index that look like this: { "foo": null, "bars": [ { "baz": "BAZ", "qux": null, "bears": [ { "fruit": "banana" } ] } ] } I want to aggregate unique values of…
knpwrs
  • 15,691
  • 12
  • 62
  • 103
3
votes
1 answer

ES 1.7.3 Elasticsearch Java client: significant terms aggregation unknown values

Out team currently on way of migration legacy project from Elasticsearch v1.7.3 to v7.8.0. It's in most part written in Scala, so along with this we would like to replace Java client : Maven Repository: org.elasticsearch » elasticsearch » 1.7.3 And…
Ivan Kurchenko
  • 4,043
  • 1
  • 11
  • 28
3
votes
0 answers

Elasticsearch 7.1: Convert mongodb aggregation pipeline to elastic search query

This is my first time using elastic search so bear with me. I have two schemas, Offers Schema and Offer Comment Schema, I need to search by offer title and have each offer result with its comments Offer Schema: { title: { type: String, …
3
votes
1 answer

how to get count of not-null value based on specific field in Elasticsearch

I have elastic search index and I need total count of records that one of fields ("actual_start") is not-null how can I do this? I have wrote this query and I want to append count of not-null actual start value to the result of my query: $params =…
Farzane Khazaei
  • 147
  • 1
  • 2
  • 12
3
votes
1 answer

How to do sorting on a field with composite aggregation in elastic search

How to do sorting on a field with composite aggregation in elastic search. We are using elastic search version 6.8.6 and trying to achieve sorting on a field with composite aggregation. But we are not able to get expected results with…
3
votes
2 answers

Elastic search aggregation using min_doc_count=0 returns all the buckets which are not related to query results or hits

Here is my query - { "from": 0, "size": 100, "query": { "bool": { "filter": [ { "terms": { "folderId.keyword": [ …
Kiran Pawar
  • 79
  • 1
  • 8
3
votes
1 answer

Bucket_script aggregation on filters aggregation over nested documents

I have my documents, and they contain nested "events" (like clicks on a website) documents. Now I want to calculate the ration between nested events with name=x and nested events with name=y This is my query: curl -XGET…
Anton
  • 936
  • 1
  • 8
  • 27
3
votes
1 answer

Elasticsearch Empty Filter Aggregations

I upgraded Elasticsearch version 5.4 to 7.1. I have a query work on 5.4 version, but the same query on 7.1 throws an exception. query malformed, empty clause found Query : { "query": {"match_all": {}} ,"aggs": { "price": { …
legend_blue
  • 93
  • 10
3
votes
1 answer

Bucket selector in sub aggregation or cardinality aggregation

I have this query GET /my_index3/_search { "size": 0, "aggs": { "num1": { "terms": { "field": "num1.keyword", "order" : { "_count" : "desc" } }, "aggs": { "count_of_distinct_suffix": { …