Package org.teiid.core.index
Interface IIndex
-
- All Known Implementing Classes:
Index
public interface IIndexAn IIndex is the interface used to generate an index file, and to make queries on this index.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes the index file if openintgetNumDocuments()Returns the number of documents indexed.intgetNumWords()Returns the number of unique words indexed.IQueryResult[]query(String word)Returns the paths of the documents containing the given word.IEntryResult[]queryEntries(char[] pattern)Returns all entries for a given word.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.voidsetDoCache(boolean doCache)sets a boolean indicating the index file will be cached and should remain open and in-memory
-
-
-
Method Detail
-
getNumDocuments
int getNumDocuments() throws IOExceptionReturns the number of documents indexed.- Throws:
IOException
-
getNumWords
int getNumWords() throws IOExceptionReturns the number of unique words indexed.- Throws:
IOException
-
query
IQueryResult[] query(String word) throws IOException
Returns the paths of the documents containing the given word.- Throws:
IOException
-
queryEntries
IEntryResult[] queryEntries(char[] pattern) throws IOException
Returns all entries for a given word.- Throws:
IOException
-
queryInDocumentNames
IQueryResult[] queryInDocumentNames(String word) throws IOException
Returns the paths of the documents whose names contain the given word.- Throws:
IOException
-
queryPrefix
IQueryResult[] queryPrefix(char[] prefix) throws IOException
Returns the paths of the documents containing the given word prefix.- Throws:
IOException
-
close
void close()
Closes the index file if open- Since:
- 5.0
-
setDoCache
void setDoCache(boolean doCache)
sets a boolean indicating the index file will be cached and should remain open and in-memory- Parameters:
doCache-- Since:
- 5.0
-
-