public class Index extends Object implements IIndex
Modifier and Type | Field and Description |
---|---|
protected boolean |
doCache |
static int |
MAX_FOOTPRINT
Maximum size of the index in memory.
|
String |
toString
String representation of this index.
|
Constructor and Description |
---|
Index(VDBResource f) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the index file if open
|
protected BlocksIndexInput |
getBlocksIndexInput() |
BlocksIndexInput |
getCachedInput() |
int |
getNumDocuments()
Returns the number of documents indexed.
|
int |
getNumWords()
Returns the number of unique words indexed.
|
String |
getResourceFileName() |
void |
initialize()
Initialises the indexGenerator.
|
IQueryResult[] |
query(String word)
Returns the paths of the documents containing the given word.
|
IEntryResult[] |
queryEntries(char[] prefix)
Returns all entries for a given word.
|
IEntryResult[] |
queryEntries(char[] prefix,
boolean isCaseSensitive)
Overloaded the method in Index to allow a user to specify if the
query should be case sensitive.
|
IEntryResult[] |
queryEntriesMatching(char[] prefix,
boolean isCaseSensitive)
Overloaded the method in Index to allow a user to specify if the
query should be case sensitive.
|
IQueryResult[] |
queryInDocumentNames(String word)
Returns the paths of the documents whose names contain the given word.
|
IQueryResult[] |
queryPrefix(char[] prefix)
Returns the paths of the documents containing the given word prefix.
|
void |
setCachedInput(BlocksIndexInput theCachedInput) |
void |
setDoCache(boolean theDoCache)
sets a boolean indicating the index file will be cached and should remain open and in-memory
|
String |
toString() |
public static final int MAX_FOOTPRINT
protected boolean doCache
public String toString
public Index(VDBResource f) throws IOException
IOException
public int getNumDocuments() throws IOException
IIndex
getNumDocuments
in interface IIndex
IOException
IIndex.getNumDocuments()
public int getNumWords() throws IOException
IIndex
getNumWords
in interface IIndex
IOException
IIndex.getNumWords()
public void initialize() throws IOException
IOException
public IQueryResult[] query(String word) throws IOException
IIndex
query
in interface IIndex
IOException
IIndex.query(java.lang.String)
public IEntryResult[] queryEntries(char[] prefix) throws IOException
IIndex
queryEntries
in interface IIndex
IOException
public IQueryResult[] queryInDocumentNames(String word) throws IOException
IIndex
queryInDocumentNames
in interface IIndex
IOException
IIndex.queryInDocumentNames(java.lang.String)
public IQueryResult[] queryPrefix(char[] prefix) throws IOException
IIndex
queryPrefix
in interface IIndex
IOException
IIndex.queryPrefix(char[])
public IEntryResult[] queryEntriesMatching(char[] prefix, boolean isCaseSensitive) throws IOException
IOException
public IEntryResult[] queryEntries(char[] prefix, boolean isCaseSensitive) throws IOException
IOException
protected BlocksIndexInput getBlocksIndexInput()
public void close()
IIndex
public void setDoCache(boolean theDoCache)
IIndex
setDoCache
in interface IIndex
public BlocksIndexInput getCachedInput()
public void setCachedInput(BlocksIndexInput theCachedInput)
public String getResourceFileName()
Copyright © 2019. All rights reserved.