Class DocumentDictionary

  • All Implemented Interfaces:
    Dictionary
    Direct Known Subclasses:
    DocumentValueSourceDictionary

    public class DocumentDictionary
    extends java.lang.Object
    implements Dictionary
    Dictionary with terms, weights, payload (optional) and contexts (optional) information taken from stored/indexed fields in a Lucene index. NOTE:
    • The term field has to be stored; if it is missing, the document is skipped.
    • The payload and contexts field are optional and are not required to be stored.
    • The weight field can be stored or can be a NumericDocValues. If the weight field is not defined, the value of the weight is 0
    • Constructor Summary

      Constructors 
      Constructor Description
      DocumentDictionary​(IndexReader reader, java.lang.String field, java.lang.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, java.lang.String field, java.lang.String weightField, java.lang.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.
      DocumentDictionary​(IndexReader reader, java.lang.String field, java.lang.String weightField, java.lang.String payloadField, java.lang.String contextsField)
      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, payloadField for the corresponding payloads for the entry and contextsField for associated contexts.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      InputIterator getEntryIterator()
      Returns an iterator over all the entries
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • payloadField

        protected final java.lang.String payloadField
        Field to read payload from
      • contextsField

        protected final java.lang.String contextsField
        Field to read contexts from
      • field

        private final java.lang.String field
      • weightField

        private final java.lang.String weightField
    • Constructor Detail

      • DocumentDictionary

        public DocumentDictionary​(IndexReader reader,
                                  java.lang.String field,
                                  java.lang.String weightField)
                           throws java.io.IOException
        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.
        Throws:
        java.io.IOException
      • DocumentDictionary

        public DocumentDictionary​(IndexReader reader,
                                  java.lang.String field,
                                  java.lang.String weightField,
                                  java.lang.String payloadField)
                           throws java.io.IOException
        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.
        Throws:
        java.io.IOException
      • DocumentDictionary

        public DocumentDictionary​(IndexReader reader,
                                  java.lang.String field,
                                  java.lang.String weightField,
                                  java.lang.String payloadField,
                                  java.lang.String contextsField)
                           throws java.io.IOException
        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, payloadField for the corresponding payloads for the entry and contextsField for associated contexts.
        Throws:
        java.io.IOException
    • Method Detail

      • getEntryIterator

        public InputIterator getEntryIterator()
                                       throws java.io.IOException
        Description copied from interface: Dictionary
        Returns an iterator over all the entries
        Specified by:
        getEntryIterator in interface Dictionary
        Returns:
        Iterator
        Throws:
        java.io.IOException