# Lucene style queries from the Java API?

**URL:** <https://discuss.elastic.co/t/lucene-style-queries-from-the-java-api/3395>\
**Category:** Elasticsearch\
**Created:** [October 1, 2010, 3:06pm UTC](https://discuss.elastic.co/t/lucene-style-queries-from-the-java-api/3395 "2010-10-01T15:06:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jake](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@Jake](https://discuss.elastic.co/u/Jake)\
**Post date:** [October 1, 2010, 3:06pm UTC](https://discuss.elastic.co/t/lucene-style-queries-from-the-java-api/3395/1 "2010-10-01T15:06:07Z")

</div>

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]

---

<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, 4:18am UTC](https://discuss.elastic.co/t/lucene-style-queries-from-the-java-api/3395/2 "2017-07-06T04:18:36Z")

</div>

Closed on July 6, 2017, 4:18am UTC


