public class LuceneSearcher extends Object implements IndexSearch
| Modifier and Type | Class and Description |
|---|---|
static class |
LuceneSearcher.SupportedRelations |
| Modifier and Type | Field and Description |
|---|---|
static String |
ALL_INDEXES |
static String |
EQUALS |
ArrayList<String> |
fieldNames |
| Constructor and Description |
|---|
LuceneSearcher() |
LuceneSearcher(String lemmatizerPluginName,
String configFilePath,
Language defaultLanguage)
constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeIndex()
Closes the previously opened index
|
URI |
executeCqlQuery(ArrayList<String> presentable,
ArrayList<String> searchable,
String queryString,
boolean isComplete,
RRadaptor adaptor)
Fills the RSClient with results from executing the queryString on an
index (Lucene only).
|
URI |
executeQuery(String queryString,
boolean isComplete)
Deprecated.
- This method applies a query expansion, before executing the query, that assumes
an old Index version was used (Index Library version < 3.0.0)
Fills the RSClient with results from executing the queryString on an
index (Lucene only).
Setting client to null will print results to system.out. |
String |
expandQuery(String query,
String defaultLemLang,
String defaultLang,
boolean onlyLemByDefault) |
void |
openIndex(String indexDir,
String indexName)
Opens the index for search operations
|
void |
setIndexType(FullTextIndexType idxType)
Updates the IndexSearch' state object
|
void |
setMaximumSnippetsCount(Integer maximumSnippetsCount) |
void |
setSnippetSize(Integer snippetSize) |
void |
updateIndex()
Updates the index.
|
public static final String EQUALS
public static final String ALL_INDEXES
public LuceneSearcher(String lemmatizerPluginName, String configFilePath, Language defaultLanguage) throws Exception
Exceptionpublic void setSnippetSize(Integer snippetSize)
public void setMaximumSnippetsCount(Integer maximumSnippetsCount)
public void openIndex(String indexDir, String indexName) throws IndexException
openIndex in interface IndexSearchindexDir - the base directory where indices are storedindexName - name of the indexIndexException - -
an error opening the indexpublic void updateIndex()
throws IndexException
updateIndex in interface IndexSearchIndexException - -
an error updating the indexpublic void setIndexType(FullTextIndexType idxType) throws IndexException
setIndexType in interface IndexSearchIndexException - -
an error setting the IndexTypepublic void closeIndex()
throws IndexException
closeIndex in interface IndexSearchIndexException - -
an error closing the indexpublic URI executeCqlQuery(ArrayList<String> presentable, ArrayList<String> searchable, String queryString, boolean isComplete, RRadaptor adaptor) throws Exception
Setting client to null will print results to system.out.
executeCqlQuery in interface IndexSearchpresentable - the field Names of the fields that are presentable in this indexsearchable - the field Names of the fields that are searchable in this indexqueryString - executed query stringisComplete - indicates if the results must contain the full payloadIndexException - -
an error executing the queryExceptionpublic URI executeQuery(String queryString, boolean isComplete) throws IndexException
Setting client to null will print results to system.out.
IndexSearchSetting client to null will print results to system.out.
executeQuery in interface IndexSearchqueryString - executed query stringisComplete - indicates if the results must contain the full payloadIndexException - -
an error executing the querypublic String expandQuery(String query, String defaultLemLang, String defaultLang, boolean onlyLemByDefault) throws IndexException
IndexExceptionCopyright © 2014. All Rights Reserved.