org.apache.lucene.search.suggest
Class DocumentExpressionDictionary
java.lang.Object
org.apache.lucene.search.suggest.DocumentDictionary
org.apache.lucene.search.suggest.DocumentExpressionDictionary
- All Implemented Interfaces:
- Dictionary
public class DocumentExpressionDictionary
- extends DocumentDictionary
Dictionary with terms and optionally payload information
taken from stored fields in a Lucene index. Similar to
DocumentDictionary
, except it computes the weight
of the terms in a document based on a user-defined expression
having one or more NumericDocValuesField
in the document.
NOTE:
-
The term and (optionally) payload fields supplied
are required for ALL documents and has to be stored
Constructor Summary |
DocumentExpressionDictionary(IndexReader reader,
String field,
String weightExpression,
Set<SortField> sortFields)
Creates a new dictionary with the contents of the fields named field
for the terms and computes the corresponding weights of the term by compiling the
user-defined weightExpression using the sortFields
bindings. |
DocumentExpressionDictionary(IndexReader reader,
String field,
String weightExpression,
Set<SortField> sortFields,
String payload)
Creates a new dictionary with the contents of the fields named field
for the terms, payloadField for the corresponding payloads
and computes the corresponding weights of the term by compiling the
user-defined weightExpression using the sortFields
bindings. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DocumentExpressionDictionary
public DocumentExpressionDictionary(IndexReader reader,
String field,
String weightExpression,
Set<SortField> sortFields)
- Creates a new dictionary with the contents of the fields named
field
for the terms and computes the corresponding weights of the term by compiling the
user-defined weightExpression
using the sortFields
bindings.
DocumentExpressionDictionary
public DocumentExpressionDictionary(IndexReader reader,
String field,
String weightExpression,
Set<SortField> sortFields,
String payload)
- Creates a new dictionary with the contents of the fields named
field
for the terms, payloadField
for the corresponding payloads
and computes the corresponding weights of the term by compiling the
user-defined weightExpression
using the sortFields
bindings.
getWordsIterator
public BytesRefIterator getWordsIterator()
throws IOException
- Description copied from interface:
Dictionary
- Return all words present in the dictionary
- Specified by:
getWordsIterator
in interface Dictionary
- Overrides:
getWordsIterator
in class DocumentDictionary
- Returns:
- Iterator
- Throws:
IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.