Questions tagged [elasticsearch-aggregation]

1111 questions
0
votes
0 answers

Paginating in aggregation in elasticsearch 2.1

I would like to paginate aggregation in 2.1. I know that it is not possible to paginate terms aggregation in elastic 2.1 and if client side implements it, it will not be efficient. But I would still like some idea about how can I go about…
0
votes
0 answers

Expected [START_OBJECT] under [field], but got a [VALUE_STRING] in [geohash_grid]

I need to get last registered record for a serial number-or serial numbers- in a restricted area, also I should clustering these records upon zoom precision in map. I'm using Elasticsearch and I've mapped my document in this shape: { "mappings":…
0
votes
1 answer

Elasticsearch aggregation on nested objects

I have an document with the following mappings: { "some_doc_name": { "mappings": { "_doc": { "properties": { "stages": { "properties": { "name": { "type": "text" …
UnsafePointer
  • 726
  • 6
  • 25
0
votes
0 answers

Aggregate by fields in _source

I have an index in elasticsearch with documents that look like this: "hits": [ { "_index": "my-index2", "_type": "my-type", "_id": "1", "_score": 1, "_source": { …
ninesalt
  • 4,054
  • 5
  • 35
  • 75
0
votes
0 answers

How to make Elasticsearch Agg query based on current agg?

my docs looks like this { cool_things: [{ name, id }, { name, id }] } How would I find the id of the one I'm currently in the aggregate. For example this is the query I'm working with. params.body.aggs = { uniqueCoolThings: { terms: { …
0
votes
1 answer

Problem in nest query for sorting in aggregation

I need to get a query from Elasticsearch for last registered records in specified area in range of specified serial numbers. for this reason I mapped my index in this shape: { "settings": { "index": { "number_of_shards": 5, "number_of_replicas":…
0
votes
1 answer

ElasticSearch NodeJS - Aggregation term return more than one source property

I need to get a unique list of things, with some of the properties that are attached. As of now this just returns a unique list of names, yet if I wanted to include the id of the aggregates doc's, what do I do? I'm using the elasticsearch npm module…
0
votes
1 answer

SumIf in in Elasticsearch aggregation

I'm trying to create a query that returns documents based on a calculation that is best compared to a SumIf in Excel. A very simplified version of my mapping is: { "item": { "properties": { "name": { "type": "text" }, …
0
votes
1 answer

Elasticsearch Alternate of Join query

Since we can't do joins in Elastic search.. what will be the alternate way to have join concept in Elasticsearch. An example would be grate. Like if user table has user_role with id and user details is saved in user_role table against that Id so how…
Ali Abdullah
  • 166
  • 8
0
votes
1 answer

Elasticsearch Query + Agg search query

Data in my elasticsearch contains a field named facilityName. I have a requirement where I have to see if there are any duplicate records with facilityNameTypeCode as "UWI" and having same facilityName value. Following is a structure example: …
0
votes
1 answer

Elasticsearch filter based on field similarity

For reference, I'm using Elasticsearch 6.4.0 I have a Elasticsearch query that returns a certain number of hits, and I'm trying to remove hits with text field values that are too similar. My query is: { "size": 10, "collapse": { "field":…
user7594529
0
votes
1 answer

What's the fastest manner to retrieve min timestamp from Elasticsearch indices?

In my opinion, there are two ways to implement it. But I don't know which is faster, because I don't have much data to test. Like SQL below: SELECT min(occur_time) FROM event_* SELECT occur_time FROM event_* order by occur_time limit 1
0
votes
1 answer

Elasticsearch.net (NEST): how to get results from two indexes?

I have two indexes: Services and Messages. The both have field "ItemId". I want to get a result that contains intersection of the both searches that return ItemId field. [1,3,5] and [1,6,8] => I need only [1] If I get the first result and then the…
0
votes
0 answers

Unexpected results when using min sub-aggregation in Elasticsearch

My documents include the fields name and date_year, and my goal is to find the most recently added names (e.g. the ten last added names with their first year of appearance and the total number of documents). I therefore have a terms aggregation on…
user3170702
  • 1,971
  • 8
  • 25
  • 33
0
votes
1 answer

ElasticSearch: nested items count in search results

I have following mapping: { "test_index" : { "mappings" : { "test_type" : { "properties" : { "field1" : { "type" : "string" }, "field2" : { "type" : "string" }, …
Bounce
  • 2,066
  • 6
  • 34
  • 65