Java plugin - Execute QueryDSL query

(בר ביטון) #1

Hi there!
I started playing with the Java API, and was wondering if what I intend to do is possible.

I would like to extend the ES functionality with a plugin, and perform my own logic on documents and aggregations returned from a query (written in the usual QueryDSL syntax ).

I the code:

public void handleRequest(final RestRequest req, final RestChannel channel){
String Query = new String(req.content().array(), "UTF-8"); // normal ES query with aggregation
// get query results
// perform my own logic
// return results
Is there a way to do that? My initial direction was trying to use client.preaperSearch(".."), but the way I understand it, this way would require parsing the query and dynamically building the filters and aggregations using searchResponseBuilder and the setQuery(), setFilter() and addAggregations() methods, and then parse the returning JSON. Is this possible?

Thanks a lot!

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit

(system) #2