0

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?

javid
  • 23
  • 3

1 Answers1

0

I just used setSource and just put my query in json format.

  SearchResponse response = client.prepareSearch("myIndex")
    .setSource("{\"query\":{\"myParser\":{\"query\":\"blabla\"}}}")
    .execute()
    .actionGet()

and it seems to work now.

javid
  • 23
  • 3