Tutorial by Examples

First of all, watch out which analyzer you are using. I was stumped for a while only to realise that the StandardAnalyzer filters out common words like 'the' and 'a'. This is a problem when your field has the value 'A'. You might want to consider the KeywordAnalyzer: See this post around the analyz...
Next, you can either create your query using the QueryParser: See this post around overriding the default operator. // Create a query parser without a default field in this example (the first argument): QueryParser queryParser = new QueryParser("", analyzer); // Optionally, set the d...
Or you can achieve the same by constructing the query yourself using their API: See this tutorial around creating the BooleanQuery. BooleanQuery multiTermQuery = new BooleanQuery(); multiTermQuery.add(new TermQuery(new Term("field_name1", "field value 1")), BooleanClause.Occur...
Then we finally pass the query to the writer to delete documents that match the query: See the answer to this question. See the API here // Remove the document by using a multi key query: // http://www.avajava.com/tutorials/lessons/how-do-i-combine-queries-with-a-boolean-query.html indexWriter....

Page 1 of 1