org.apache.lucene.search.suggest
Class DocumentExpressionDictionary

java.lang.Object
  extended by org.apache.lucene.search.suggest.DocumentDictionary
      extended by 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:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.search.suggest.DocumentDictionary
DocumentDictionary.DocumentInputIterator
 
Field Summary
 
Fields inherited from class org.apache.lucene.search.suggest.DocumentDictionary
payloadField, reader
 
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.
 
Method Summary
 BytesRefIterator getWordsIterator()
          Return all words present in the dictionary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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.

Method Detail

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.