Now that we have an IndexSearcher
, we are ready to proceed to querying. To begin, we will need to construct a Query
object to pass into IndexSearch's
search method. There are a couple ways to construct a Query. Using a QueryParser
class or constructing a Query programmatically, QueryParser
provides the utility to interpret text and convert it into a Query. If you need to use search modifiers (for example, term must exist), there is a certain syntax to follow in order to form a query string. By default, a search phrase will return any documents that have matches on any of the query terms. We will demonstrate both QueryParser
and constructing your own Query in this section.
Lucene 4 Cookbook
By :
Lucene 4 Cookbook
By:
Overview of this book
Table of Contents (16 chapters)
Lucene 4 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Introducing Lucene
Analyzing Your Text
Indexing Your Data
Searching Your Indexes
Near Real-time Searching
Querying and Filtering Data
Flexible Scoring
Introducing Elasticsearch
Extending Lucene with Modules
Index
Customer Reviews