Query post processing

Hi,
I need an elasticsearch plugin which will build and add filter to each
query passed to Elasticsearch. Above short scenario is showed:

  1. Query string is sent to Elasticsearch
  2. Query is parsed and prepared to execute on cluster
  3. A filter is build based eg. on query, current time etc. and added to a
    query
  4. Modified query is executed on Elasticsearch cluster

I'm wondering if I can do a plugin which will be triggered each time a
query is being processed.

I know I can make a plugin with my own query parser but it also has
drawback. Because all queries will have to contain something like:

{
"query" : {
"bool": {
"must": [
{
"term": {
"some_field": "some_term"
}
},
{
"CUSTOM_QUERY_TYPE": {
"enabled": "true"
}
}
]
}
}

But this looks not to be so convenient because client application will
always have to extend the original query.

Is it possible to build plugin with query post processing and avoid
building query parser or Rest action?

--
Paweł Róg

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAF9ZkbOU0FSNUXF%2B7DEyXPebVsVhYHhZ158YJZc0EVY%2BrpvEyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.