Chained ES query/results

Hi,

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.

Cheers,
Dan

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?

hey,

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 https://github.com/elastic/elasticsearch/issues/32789

--Alex

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