A generation is analogous to versioning in a revision control system. In TrackingIndexWriter, when an index changes, a new generation is created and can be used to open the index in that particular point in time. TrackingIndexWriter is a wrapper class to IndexWriter. It provides the corresponding addDocument
, updateDocument
, and deleteDocument
methods to keep a track of index changes. On each update, a long value is returned, reflecting the current index generation. This value can be used to acquire an IndexSearcher that includes all the updates up to this specific point (generation). This class is intended to run alongside with ControlledRealTimeReopenThread
. The ControlledRealTimeReopenThread
is a utility class that runs as a separate thread managing the periodic reopening of the IndexSearcher. It accepts the TrackingIndexWriter
and SearcherManager
in its constructor to initialize this object. The generation value returned from TrackingIndexWriter...
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