Match_query inside script? [Elasticsearch]

I have a rather complicated aggregation; its complexity is caused by the lack of has_parent aggregation. Since it is implemented using groovy. The only problem I am facing is filtering out documents counted in aggregation.

The aggregation is as follows: https://gist.github.com/serj-p/c4fcc9810b3b627de294 the purpose of this association is to build the pinnacle of contact with universities. The contact document has child documents, which are facebook profiles. The latter have nested fields representing universities, so I refer to the _source field.

As you probably see, I'm filtering at the beginning:

{ "match_phrase_prefix": { "organizations.name": "stan" } } 

to exclude contacts that do not have relevant documents. "organization.name" parsed as

  { "filter": [ "lowercase", "standard", "trim", "asciifolding", ], "type": "custom", "tokenizer": "standard" } 

text that is an applicator for filtering this field is analyzed in a similar way. It was very difficult for me to do the same processing of the field value and the filtering text inside the script, which should filter certain attached documents. This is why I am looking for some opportunity to access the ES API from a script to do this.

Thanks in advance for any advice.

+7
elasticsearch
source share

No one has answered this question yet.

See similar questions:

5
Attaching Reverse_Provided Aggregates in Elasticsearch

or similar:

599
Solr vs ElasticSearch
438
Elasticsearch request to return all records
350
Do elasticsearch only return specific fields?
312
Removing data from ElasticSearch
3
How to highlight nested objects in Elasticsearch v5
one
indexing and full-text search in elasticsearch without dialectics using C # client Nest
one
How to return the actual value (not in lower case) when performing a search with aggregation of terms?
0
Elasticsearch, distance field not displayed as a result
0
Cache _source in memory in elastisearch
0
Elasticsearch nested aggregation from memory even only 5 documents

All Articles