Cross-posted from http://stackoverflow.com/questions/30170098/how-to-access-the-underlying-lucene-index-in-elasticsearch-custom-handler due to a lack of replies.
My current project involves search over highly customised Solr
indices. It turns out that the best way to query those is to use the
Lucene API.
In Solr, I can access the underlying Lucene index using:
public void process(ResponseBuilder responseBuilder) throws IOException {
SolrIndexSearcher sir = responseBuilder.req.getSearcher();
BooleanQuery bq = new BooleanQuery();
Query tq = new TermQuery(new Term("content", "test"));
bq.add(tq, BooleanClause.Occur.MUST);
TopDocs td = sir.search(bq, 20);
}
Now, ElasticSearch seems to hide the Lucene functionalities. Is there
a way to expose the Lucene index at ES query handler level, or to query
it similarly to the example above (i.e. direct querying over index
fields) using the ES API?