Is it possible to build a plugin that can add additional records to a query result before the aggregation of the data happens?
I have data external to the index that identifies additional documents from the index that I would like included. These are documents that do not match the search criteria, but that I know are relevant based on other data/analysis.
So I would like to inject these related documents into the results before the aggregation happens.
The basic idea is to check and external data source, for each matching document if there are related documents and pull them into the result.
You could write a plugin that modifies the query, but I would opt to modify
the query on the client side instead.
What does the external source provide? Additional document ids or
additional search criteria? For the former, simply add an Ids query [1]
alongside your original query in a should clause [2]
The external data source provides additional document IDs, based on the documents returned from the query. So I don't have the extra document IDs until after I run the query.
run query to get keyword matches
for each matching document lookup related non-matching documents & add to hits
aggregate result
visualize in Kibana
Step 2 is a proprietary algorithm that works on a different data structure.
I'm hoping that an ES plugin can make steps 1,2,3 transparent to the client Kibana.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.