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
IOExceptionpublic int getNumDocuments()
throws IOException
IIndexgetNumDocuments in interface IIndexIOExceptionIIndex.getNumDocuments()public int getNumWords()
throws IOException
IIndexgetNumWords in interface IIndexIOExceptionIIndex.getNumWords()public void initialize()
throws IOException
IOExceptionpublic IQueryResult[] query(String word) throws IOException
IIndexquery in interface IIndexIOExceptionIIndex.query(java.lang.String)public IEntryResult[] queryEntries(char[] prefix) throws IOException
IIndexqueryEntries in interface IIndexIOExceptionpublic IQueryResult[] queryInDocumentNames(String word) throws IOException
IIndexqueryInDocumentNames in interface IIndexIOExceptionIIndex.queryInDocumentNames(java.lang.String)public IQueryResult[] queryPrefix(char[] prefix) throws IOException
IIndexqueryPrefix in interface IIndexIOExceptionIIndex.queryPrefix(char[])public IEntryResult[] queryEntriesMatching(char[] prefix, boolean isCaseSensitive) throws IOException
IOExceptionpublic IEntryResult[] queryEntries(char[] prefix, boolean isCaseSensitive) throws IOException
IOExceptionprotected BlocksIndexInput getBlocksIndexInput()
public void close()
IIndexpublic void setDoCache(boolean theDoCache)
IIndexsetDoCache in interface IIndexpublic BlocksIndexInput getCachedInput()
public void setCachedInput(BlocksIndexInput theCachedInput)
public String getResourceFileName()
Copyright © 2019. All rights reserved.