public class MemoryIndex extends Index implements UpdatableIndex, WritableIndex
Index.UpdatingCollectionStatistics| Modifier and Type | Field and Description |
|---|---|
static boolean |
blocks |
protected CompressionFactory.CompressionConfiguration |
compressionConfig |
protected DocumentPostingList |
docPostings
FIXME
|
protected MemoryDocumentIndex |
document |
gnu.trove.TObjectIntHashMap<String> |
fieldIDs |
static boolean |
fields |
static String[] |
fieldtags |
protected Object |
indexingLock
A lock that stops multiple indexing operations from happening at once
|
protected MemoryInvertedIndex |
inverted |
protected MemoryLexicon |
lexicon |
protected static org.slf4j.Logger |
logger |
protected MemoryMetaIndex |
metadata |
protected TermPipeline |
pipeline_first
FIXME
|
protected static String |
PIPELINE_NAMESPACE
FIXME
|
protected MemoryCollectionStatistics |
stats |
dirtyProperties, EMPTY_CLASS_ARRAY, lastLoadError, MINIMUM_INDEX_TERRIER_VERSION, properties, PROPERTIES_SUFFIX, RETRIEVAL_LOADING_PROFILE| Constructor and Description |
|---|
MemoryIndex()
Constructor.
|
MemoryIndex(IndexOnDisk superIndex) |
MemoryIndex(IndexOnDisk superIndex,
boolean compressedMeta)
Create a memory index from an existing on-disk index.
|
MemoryIndex(MemoryLexicon tmplex,
MemoryDocumentIndexMap document,
MemoryInvertedIndex inverted,
MemoryMetaIndex metadata,
MemoryCollectionStatistics stats) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addToDocument(int docid,
Document doc)
Adds specified content contents to the named document id.
|
boolean |
addToDocument(int docid,
DocumentPostingList docContents)
Adds relevant terms to the named document id.
|
void |
close()
Not implemented.
|
void |
collectProperties(Index memory,
Index newIndex,
CompressionFactory.CompressionConfiguration compressionConfig)
Collect index properties.
|
void |
flush()
Not implemented.
|
CollectionStatistics |
getCollectionStatistics()
Get the collection statistics
|
PostingIndex<?> |
getDirectIndex()
Not implemented.
|
DocumentIndex |
getDocumentIndex()
Return the DocumentIndex associated with this index
|
protected TermPipeline |
getEndOfPipeline()
FIXME
|
Object |
getIndexStructure(String structureName)
Obtains the named index structure, using an already loaded one if
possible.
|
Object |
getIndexStructureInputStream(String structureName)
Return the input stream associated with the specified structure of this
index
|
PostingIndex<?> |
getInvertedIndex()
Returns the InvertedIndex to use for this index
|
Lexicon<String> |
getLexicon()
Return the Lexicon associated with this index
|
MetaIndex |
getMetaIndex()
Get the Meta Index structure
|
void |
indexDocument(Document doc)
Index a new document.
|
void |
indexDocument(Map<String,String> docProperties,
DocumentPostingList docContents)
Index a new document.
|
protected void |
load_pipeline()
FIXME
|
boolean |
removeDocument(int docid)
Removes a document from the index.
|
String |
toString()
Returns a String representation of this index
|
Index |
write(String path,
String prefix)
Write index structures to disk.
|
addIndexStructure, addIndexStructure, addIndexStructure, addIndexStructure, addIndexStructureInputStream, addIndexStructureInputStream, addIndexStructureInputStream, addIndexStructureInputStream, allExists, createIndex, createIndex, createNewIndex, existsIndex, getEnd, getIndexLoadingProfileAsRetrieval, getIndexProperty, getIntIndexProperty, getLastIndexLoadError, getProperties, getStart, hasIndexStructure, hasIndexStructureInputStream, join, main, setIndexLoadingProfileAsRetrieval, setIndexPropertyprotected static final org.slf4j.Logger logger
protected MemoryLexicon lexicon
protected MemoryInvertedIndex inverted
protected MemoryMetaIndex metadata
protected MemoryDocumentIndex document
protected MemoryCollectionStatistics stats
public static final boolean blocks
public static final boolean fields
public static final String[] fieldtags
public gnu.trove.TObjectIntHashMap<String> fieldIDs
protected Object indexingLock
protected CompressionFactory.CompressionConfiguration compressionConfig
protected DocumentPostingList docPostings
protected TermPipeline pipeline_first
protected static final String PIPELINE_NAMESPACE
public MemoryIndex(MemoryLexicon tmplex, MemoryDocumentIndexMap document, MemoryInvertedIndex inverted, MemoryMetaIndex metadata, MemoryCollectionStatistics stats)
public MemoryIndex()
public MemoryIndex(IndexOnDisk superIndex)
public MemoryIndex(IndexOnDisk superIndex, boolean compressedMeta)
superIndex - compressedMeta - public Object getIndexStructure(String structureName)
getIndexStructure in class IndexstructureName - name of the required structurepublic Lexicon<String> getLexicon()
getLexicon in class Indexpublic PostingIndex<?> getInvertedIndex()
getInvertedIndex in class Indexpublic MetaIndex getMetaIndex()
getMetaIndex in class Indexpublic DocumentIndex getDocumentIndex()
getDocumentIndex in class Indexpublic CollectionStatistics getCollectionStatistics()
getCollectionStatistics in class Indexpublic PostingIndex<?> getDirectIndex()
getDirectIndex in class Indexpublic Object getIndexStructureInputStream(String structureName)
getIndexStructureInputStream in class IndexstructureName - The name of the structure of which you want the inputstream.
Eg "lexicon"public void indexDocument(Document doc) throws Exception
indexDocument in interface UpdatableIndexExceptionpublic void indexDocument(Map<String,String> docProperties, DocumentPostingList docContents) throws Exception
indexDocument in interface UpdatableIndexExceptionpublic boolean addToDocument(int docid,
Document doc)
throws Exception
NB: This implementation uses addToDocument(int, DocumentPostingList) internally.
addToDocument in interface UpdatableIndexExceptionpublic boolean addToDocument(int docid,
DocumentPostingList docContents)
throws Exception
addToDocument in interface UpdatableIndexExceptionpublic Index write(String path, String prefix) throws IOException
write in interface WritableIndexIOExceptionpublic void collectProperties(Index memory, Index newIndex, CompressionFactory.CompressionConfiguration compressionConfig)
collectProperties in interface WritableIndexpublic String toString()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class IndexIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class IndexIOExceptionprotected TermPipeline getEndOfPipeline()
protected void load_pipeline()
public boolean removeDocument(int docid)
UpdatableIndexremoveDocument in interface UpdatableIndexTerrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow