concept match in category lucene

This is an excerpt from Manning's book Lucene in Action, Second Edition.
Don’t underestimate the importance of result presentation. Simple details, like failing to highlight matches in the titles and excerpts, or using a small font and cramming too much text into the results, can quickly kill a user’s search experience. Be sure the sort order is clearly called out and defaults to an appropriate starting point (usually relevance). Be fully transparent: if your search application is doing something “interesting,” such as expanding the search to include synonyms, using boosts to influence sort order, or automatically correcting spelling, say so clearly at the top of the search results and make it easy for the user to turn it off.
public void testGrouping() throws Exception { Query query = new QueryParser( Version.LUCENE_30, "subject", analyzer).parse("(agile OR extreme) AND methodology"); TopDocs matches = searcher.search(query, 10); assertTrue(TestUtil.hitsIncludeTitle(searcher, matches, "Extreme Programming Explained")); assertTrue(TestUtil.hitsIncludeTitle(searcher, matches, "The Pragmatic Programmer")); }
While searching, span queries track more than the documents that match: the individual spans, perhaps more than one per field, are also tracked. Contrasting with TermQuery, which simply matches documents, SpanTermQuery matches exactly the same documents but also keeps track of the positions of every term occurrence that matches. Generally this is more compute-intensive. For example, when TermQuery finds a document containing its term, it records that document as a match and immediately moves on, whereas SpanTermQuery must enumerate all the occurrences of that term within the document.
The SpanNotQuery excludes matches where one SpanQuery overlaps another. The following code demonstrates:





