This recipe demonstrates how to use the
QueryParser class to execute free-form queries against an index. The purpose of the
QueryParser class is to primarily take manually entered search queries and parse them into a Lucene.NET query structure that can be executed against the content in a Lucene.NET index. The expression syntax is quite expressive and powerful, allowing many logical operations and inclusion/exclusion constructs, and we will see examples of this as we progress through more recipes.
The example for this recipe starts out similar to the previous example, by indexing the same two novels. Like the TermQuery recipe, an
IndexSearcher object is created, and then five searches are ...