public class LuceneWordIndex extends LuceneIndex implements WordIndex
| Modifier and Type | Field and Description |
|---|---|
protected static String |
FIELD_ID |
protected static String |
FIELD_TEXT |
protected static String |
FIELD_WORDS |
protected static org.slf4j.Logger |
log |
protected static int |
NUM_CANDIDATES |
protected static String |
PARAM_FUZZY |
protected static String |
PARAM_PROXIMITY |
analyzer, preprocessor, reader, searcher, sim| Constructor and Description |
|---|
LuceneWordIndex() |
LuceneWordIndex(Iterable<String> texts) |
LuceneWordIndex(LookupCacheEncoder encoder) |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.lucene.analysis.Analyzer |
buildAnalyzer() |
void |
createIndex(Iterable<String> texts,
org.apache.lucene.store.Directory index) |
void |
createIndexDirectory(Iterable<String> texts,
Resource cacheDir) |
void |
createIndexRAM(Iterable<String> texts)
Creates and opens a new index in local RAM
|
List<String> |
queryExactText(String text,
int hits)
Retrieve candidates for a query on the "text" field.
|
protected List<String> |
queryIndex(org.apache.lucene.search.Query query,
int hits) |
List<String> |
queryPrefixText(String prefix,
int hits)
Retrieve candidates for auto completion on the "text" field.
|
List<String> |
queryText(String text,
int hits)
Retrieve candidates for a query on the "text" field.
|
addNameField, addStringField, addTextField, openIndex, openIndex, splitStringprotected static final org.slf4j.Logger log
protected static final String FIELD_WORDS
protected static final String FIELD_TEXT
protected static final String FIELD_ID
protected static final String PARAM_PROXIMITY
protected static final String PARAM_FUZZY
protected static final int NUM_CANDIDATES
public LuceneWordIndex()
public LuceneWordIndex(LookupCacheEncoder encoder)
public void createIndexRAM(Iterable<String> texts)
public void createIndexDirectory(Iterable<String> texts, Resource cacheDir) throws IOException
IOExceptionpublic void createIndex(Iterable<String> texts, org.apache.lucene.store.Directory index)
public List<String> queryText(String text, int hits)
public List<String> queryExactText(String text, int hits)
queryExactText in interface WordIndexpublic List<String> queryPrefixText(String prefix, int hits)
queryPrefixText in interface WordIndexprotected org.apache.lucene.analysis.Analyzer buildAnalyzer()
buildAnalyzer in class LuceneIndexCopyright © 2020. All rights reserved.