public interface MemoryIndex extends 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(Set<Pair<String,String>> data,
Settings settings)
Creates and loads data into an in memory index.
|
org.apache.lucene.search.Query |
parseQuery(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(String searchString,
int maxQueryResults)
Searches the index using the given search string.
|
org.apache.lucene.document.Document getDocument(int documentId)
throws IOException
documentId - the id of the document to retrieveIOException - thrown if there is an IOExceptionvoid open(Set<Pair<String,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(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(String searchString, int maxQueryResults) throws org.apache.lucene.queryparser.classic.ParseException, IndexException, 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 analyzerIOException - 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,
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 corruptIOException - thrown if there is an IOExceptionvoid close()
close in interface AutoCloseableCopyright © 2012–2020 OWASP. All rights reserved.