I have a custom query parser and I can query my Index using Sense as follows:
GET myIndex/_search
{
"query": {
"myParser":{
"query" : "blabla"
}
}
}
My question is, how can I parse the query with myParser in Search Api? How do I mention Parser in QueryBuilders?
@mainec Thank you for your answer.
I'm relatively new to elasticsearch, so please bear with me
I use ES 2.x
I installed the new parser plugin to my ES, and I thought, if I can use it via Sense, then I can do the same when I use Search Api. Like, building query, and mention there somehow, that you want to parse this query with myParser.
@mainec The plugin is is written by my collegue. and I have the source code as well.
I used it via Sense, and it works.
Yes, I mean Java Search Api.
Javid
I believe what you are missing is implementing a QueryBuilder. No need to actually put that into the QueryBuilders class, you can create instances for that from your application code.
The important part that this QueryBuilder will need is a toXContent method. Checkout the other QueryBuilder implementations in the Elasticsearch code base for examples.
One warning: This infrastructure changes substantially when switching to 5.0.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.