Lucene style queries from the Java API?


(Jake) #1

I'm using version 0.11 and the Java API to search on my 'title' field like so:

SearchResponse response = client.prepareSearch("documents")
.setQuery(QueryBuilders.termQuery("title", "jakarta apache"))
.execute()
.actionGet();

How would I represent the following Lucene style query in the Java API?

title:"jakarta apache" NOT title:"Apache Lucene"

[jake]


(system) #2