Chained ES query/results


If I have a _location index, and a _search index, is there a way to search the _location index to say convert a language specific string like 'London' or 'Londres' to a number say 2543, and use this as part of the query into the _search (e.g. location:2543) and return some detail also from the _location index e.g. name,lat_long etc

I can do this in Solr with SearchComponent and an EmbeddedSolrServer and would be keen to replicate in ES.


I think looking into this a bit further that it might require a custom QueryBuilder that uses org.elasticsearch.action.get.GetRequest similar to GeoShapeQueryBuilder or TermsQueryBuilder, has anyone pursued a similar answer this way perhaps?


if possible I would try to stay away from the query-within-query pattern and see if it can be solved on index time by enriching the document using a node ingest processor.

There is currently some work being done to enrich a document based on a query before indexing, see this issue


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.