public class MemoryMetaIndex extends MetaIndexBuilder implements MetaIndex, Serializable
Properties
Constructor and Description |
---|
MemoryMetaIndex() |
MemoryMetaIndex(String[] metaKeys,
int[] metaLengths) |
MemoryMetaIndex(String[] metaKeys,
int[] metaLengths,
String[] revKeys) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Delete contents of metadata index (but keep the configured keys).
|
String[] |
getAllItems(int docid)
Obtain all metadata for specified document.
|
int |
getDocument(String key,
String value)
Obtain docid where document has specified metadata value in the specified type.
|
String |
getItem(String key,
int docid)
Obtain metadata of specified type for specified document.
|
String[] |
getItems(String[] keys,
int docid)
Obtain metadata of specified types for specified document.
|
String[][] |
getItems(String[] keys,
int[] docids)
Obtain metadata of specified types for specified documents.
|
String[] |
getItems(String key,
int[] docids)
Obtain metadata of specified type for specified documents.
|
int[] |
getKeyLengths() |
String[] |
getKeys()
Returns the keys of this meta index
|
String[] |
getReverseKeys()
Returns the reverse keys of this meta index
|
Iterator<String[]> |
iterator()
Return iterator over meta-data index.
|
void |
writeDocumentEntry(Map<String,String> data)
Write meta-data for document.
|
void |
writeDocumentEntry(String[] data)
This method has been made public for creating
|
public MemoryMetaIndex()
public MemoryMetaIndex(String[] metaKeys, int[] metaLengths)
public String[] getKeys()
public String getItem(String key, int docid) throws IOException
getItem
in interface MetaIndex
IOException
public String[] getAllItems(int docid) throws IOException
getAllItems
in interface MetaIndex
IOException
public String[] getItems(String key, int[] docids) throws IOException
getItems
in interface MetaIndex
IOException
public String[] getItems(String[] keys, int docid) throws IOException
getItems
in interface MetaIndex
IOException
public String[][] getItems(String[] keys, int[] docids) throws IOException
getItems
in interface MetaIndex
IOException
public void writeDocumentEntry(Map<String,String> data)
writeDocumentEntry
in class MetaIndexBuilder
public void writeDocumentEntry(String[] data)
writeDocumentEntry
in class MetaIndexBuilder
data
- public int getDocument(String key, String value) throws IOException
MetaIndex
getDocument
in interface MetaIndex
IOException
public String[] getReverseKeys()
MetaIndex
getReverseKeys
in interface MetaIndex
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public int[] getKeyLengths()
Terrier Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow