How to get side information to and from queries


I have a custom-developed Lucene Query class... it has been integrated into Elasticsearch with a custom QueryParser module and the key functionality is working.

However there are two aspects that I would really like some guidance on:

  1. The Lucene Query class requires some configuration information which is being updated frequently (it's an online learner). Of course I can pass the configuration data across from the client with each search query, but it's a bit bulky. Are there any pre-existing facilities in ES to send data across to all shards and keep it in a cache of sorts for use by the QueryParser/Query?

  2. Aside from generating the list of top docs, the Query also produces some side information (needed to update the state of the online learner) that needs to be centrally coordinated, so I'd like to have it passed back with the search results to the client. Does ES have any built-in mechanism to do this? At this stage I see my options as (a) add a custom (fake) aggregation to report the data, or (b) add a second custom query to retrieve the data (presumably cached somewhere) on a subsequent request.

Thanks for any suggestions.

(system) #2