public interface MemoryIndex
extends java.lang.AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the MemoryIndex.
|
org.apache.lucene.document.Document |
getDocument(int documentId)
Retrieves a document from the Index.
|
void |
open(java.util.Set<Pair<java.lang.String,java.lang.String>> data,
Settings settings)
Creates and loads data into an in memory index.
|
org.apache.lucene.search.Query |
parseQuery(java.lang.String searchString)
Parses the given string into a Lucene Query.
|
org.apache.lucene.search.TopDocs |
search(org.apache.lucene.search.Query query,
int maxQueryResults)
Searches the index using the given query.
|
org.apache.lucene.search.TopDocs |
search(java.lang.String searchString,
int maxQueryResults)
Searches the index using the given search string.
|
org.apache.lucene.document.Document getDocument(int documentId)
throws java.io.IOException
documentId - the id of the document to retrievejava.io.IOException - thrown if there is an IOExceptionvoid open(java.util.Set<Pair<java.lang.String,java.lang.String>> data, Settings settings) throws IndexException
data - the CPE datasettings - a reference to the dependency-check settingsIndexException - thrown if there is an error creating the indexorg.apache.lucene.search.Query parseQuery(java.lang.String searchString)
throws org.apache.lucene.queryparser.classic.ParseException,
IndexException
searchString - the search textorg.apache.lucene.queryparser.classic.ParseException - thrown if the search text cannot be parsedIndexException - thrown if there is an error resetting the
analyzersorg.apache.lucene.search.TopDocs search(java.lang.String searchString,
int maxQueryResults)
throws org.apache.lucene.queryparser.classic.ParseException,
IndexException,
java.io.IOException
searchString - the query textmaxQueryResults - the maximum number of documents to returnorg.apache.lucene.queryparser.classic.ParseException - thrown when the searchString is invalidIndexException - thrown when there is an internal error resetting
the search analyzerjava.io.IOException - is thrown if there is an issue with the underlying
Indexorg.apache.lucene.search.TopDocs search(org.apache.lucene.search.Query query,
int maxQueryResults)
throws org.apache.lucene.index.CorruptIndexException,
java.io.IOException
query - the query used to search the indexmaxQueryResults - the max number of results to returnorg.apache.lucene.index.CorruptIndexException - thrown if the Index is corruptjava.io.IOException - thrown if there is an IOExceptionvoid close()
close in interface java.lang.AutoCloseableCopyright© 2012-21 Jeremy Long. All Rights Reserved.