org.apache.lucene.search.suggest
Class DocumentDictionary

java.lang.Object
  extended by org.apache.lucene.search.suggest.DocumentDictionary
All Implemented Interfaces:
Dictionary
Direct Known Subclasses:
DocumentExpressionDictionary

public class DocumentDictionary
extends Object
implements Dictionary

Dictionary with terms, weights and optionally payload information taken from stored fields in a Lucene index. NOTE:


Nested Class Summary
protected  class DocumentDictionary.DocumentInputIterator
          Implements InputIterator from stored fields.
 
Field Summary
protected  String payloadField
          Field to read payload from
protected  IndexReader reader
          IndexReader to load documents from
 
Constructor Summary
DocumentDictionary(IndexReader reader, String field, String weightField)
          Creates a new dictionary with the contents of the fields named field for the terms and weightField for the weights that will be used for the corresponding terms.
DocumentDictionary(IndexReader reader, String field, String weightField, String payloadField)
          Creates a new dictionary with the contents of the fields named field for the terms, weightField for the weights that will be used for the the corresponding terms and payloadField for the corresponding payloads for the entry.
 
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
 

Field Detail

reader

protected final IndexReader reader
IndexReader to load documents from


payloadField

protected final String payloadField
Field to read payload from

Constructor Detail

DocumentDictionary

public DocumentDictionary(IndexReader reader,
                          String field,
                          String weightField)
Creates a new dictionary with the contents of the fields named field for the terms and weightField for the weights that will be used for the corresponding terms.


DocumentDictionary

public DocumentDictionary(IndexReader reader,
                          String field,
                          String weightField,
                          String payloadField)
Creates a new dictionary with the contents of the fields named field for the terms, weightField for the weights that will be used for the the corresponding terms and payloadField for the corresponding payloads for the entry.

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
Returns:
Iterator
Throws:
IOException


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.