Example usage for Java org.apache.lucene.index.memory MemoryIndex fields, constructors, methods, implement or subclass
The text is from its open source code.
MemoryIndex() Constructs an empty instance that will not store offsets or payloads. | |
MemoryIndex(boolean storeOffsets) Constructs an empty instance that can optionally store the start and end character offset of each token term in the text. |
void | addField(String fieldName, String text, Analyzer analyzer) Convenience method; Tokenizes the given field text and adds the resulting terms to the index; Equivalent to adding an indexed non-keyword Lucene org.apache.lucene.document.Field that is tokenized, not stored, termVectorStored with positions (or termVectorStored with positions and offsets), |
void | addField(String fieldName, TokenStream stream, int positionIncrementGap) Iterates over the given token stream and adds the resulting terms to the index; Equivalent to adding a tokenized, indexed, termVectorStored, unstored, Lucene org.apache.lucene.document.Field . |
void | addField(IndexableField field, Analyzer analyzer) Adds a lucene IndexableField to the MemoryIndex using the provided analyzer. |
void | addField(String fieldName, TokenStream stream) Iterates over the given token stream and adds the resulting terms to the index; Equivalent to adding a tokenized, indexed, termVectorStored, unstored, Lucene org.apache.lucene.document.Field . |
IndexSearcher | createSearcher() Creates and returns a searcher that can be used to execute arbitrary Lucene queries and to collect the resulting query results as hits. |
MemoryIndex | fromDocument(Iterable extends IndexableField> document, Analyzer analyzer) Builds a MemoryIndex from a lucene Document using an analyzer |
MemoryIndex | fromDocument(Iterable extends IndexableField> document, Analyzer analyzer, boolean storeOffsets, boolean storePayloads) Builds a MemoryIndex from a lucene Document using an analyzer |
void | reset() Resets the MemoryIndex to its initial state and recycles all internal buffers. |
float | search(Query query) Convenience method that efficiently returns the relevance score by matching this index against the given Lucene query expression. |