THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
The first big change in flexible indexing is the consumption of the postings enumerators APIs:
Wiki Markup A term is now an arbitrary {{byte\[\]}}, represented by a {{BytesRef}} (which references an offset + length "slice" into an existing {{byte\[\]}}). By default terms will be UTF8 encoded character string, created during indexing, but your analysis chain can produce a term that is not UTF8 bytes. \\
- Fields are separately enumerated (via
FieldsEnum
) from term text. Consumers of the flex API no longer need to checkTerm.field()
on each.next()
call; instead, they obtain aTermsEnum
for the specific field they need and iterate it until exhaustion. TermsEnum
iterates and seeks to all terms (returned asBytesRef
) in the index. ATermsEnum
is optionally able to seek to the ordinal (long) for the term, and return the ordinal for the current term.SegmentReader
implements this butMultiReader
does not because working with ords is far too costly (requires merging).- Deleted documents are no longer implicitly filtered by
DocsEnum
(previouslyTermDocs
). Instead, you provide an arbitraryskipDocs
bit set (Bits
) stating which documents should be skipped during enumeration. For example, this could be used with a cached filter to enforce your own deletions.IndexReader.getDeletedDocs
returns a Bits for the current deleted docs of this reader. - Seeking to a term is no longer done by the docs/positions enums; instead, you must use
TermsEnum.seek
and thenTermsEnum.docs
or.docsAndPositions
to obtain the enumerator (there are also sugar APIs to accomplish this).TermsEnum
's seek method has three return values:FOUND
(the exact term matched),NOT_FOUND
(another term matched) andEND
(you seek'd past the end of the enum). - Composite readers (currently
MultiReader
orDirectoryReader
) are not able to provide these postings enumerators directly; instead, one must use the static methods onMultiFields
to obtain the enumerators.
...