# Index-selection plugin - Parsing a search-query

**URL:** <https://discuss.elastic.co/t/index-selection-plugin-parsing-a-search-query/11655>\
**Category:** Elasticsearch\
**Created:** [April 22, 2013, 12:58pm UTC](https://discuss.elastic.co/t/index-selection-plugin-parsing-a-search-query/11655 "2013-04-22T12:58:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Per\_Berglund](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@Per\_Berglund](https://discuss.elastic.co/u/Per_Berglund)\
**Post date:** [April 22, 2013, 12:58pm UTC](https://discuss.elastic.co/t/index-selection-plugin-parsing-a-search-query/11655/1 "2013-04-22T12:58:49Z")

</div>

Hi,

I'm working on a plugin called Index-Selec[https://github.com/bergetp/elasticsearch-index-select-plugin](https://github.com/bergetp/elasticsearch-index-select-plugin)t.  
The plugin estimates which indices are most likely to contain relevant  
documents to a query-string.

The idea is that when the relevance of the indices has been estimated a  
search-query should be performed on the most relevant indices. The  
search-query  
should be included in the request-body of the index-select request.

The problem I'm having is parsing the search-query. Unfortunately the  
methods used to parse a search-query are hidden in the search rest-handler.  
A  
very bad solution would be to copy this code to my own rest-handler, and  
update it for every new version of ElasticSearch.

Is there perhaps a way to forward a request to another rest-handler inside  
of ElasticSearch? I should mention that the index-selection operation is  
handled on the transport-level.

Thanks!

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:40am UTC](https://discuss.elastic.co/t/index-selection-plugin-parsing-a-search-query/11655/2 "2017-07-06T02:40:12Z")

</div>

Closed on July 6, 2017, 2:40am UTC


