We have learned very early on that Lucene stores data in an inverted index in which terms are sorted and DocId is associated with each term. A search is essentially finding DocId's intersection in matched terms. The index itself allows for a very fast term lookup, but it's not ideal for lookup by DocId. To solve the problem of finding a field value by DocId, Lucene introduced FieldCache
. FieldCache is an in-memory data structure that stored in an array format in which the value position corresponds to DocId (since DocId is basically an ordinal value of all documents). Because each array position can only store one value, FieldCache should be used on single-valued fields only. In essence, Lucene uninverts data from the index and stores them in FieldCache.
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