Class Fields

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.String>
    Direct Known Subclasses:
    FieldsProducer, FilterAtomicReader.FilterFields, MultiFields

    public abstract class Fields
    extends java.lang.Object
    implements java.lang.Iterable<java.lang.String>
    Flex API for access to fields and terms
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Fields[] EMPTY_ARRAY
      Zero-length Fields array.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      long getUniqueTermCount()
      Deprecated.
      iterate fields and add their size() instead.
      abstract java.util.Iterator<java.lang.String> iterator()
      Returns an iterator that will step through all fields names.
      abstract int size()
      Returns the number of fields or -1 if the number of distinct field names is unknown.
      abstract Terms terms​(java.lang.String field)
      Get the Terms for this field.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • EMPTY_ARRAY

        public static final Fields[] EMPTY_ARRAY
        Zero-length Fields array.
    • Method Detail

      • iterator

        public abstract java.util.Iterator<java.lang.String> iterator()
        Returns an iterator that will step through all fields names. This will not return null.
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.String>
      • terms

        public abstract Terms terms​(java.lang.String field)
                             throws java.io.IOException
        Get the Terms for this field. This will return null if the field does not exist.
        Throws:
        java.io.IOException
      • size

        public abstract int size()
        Returns the number of fields or -1 if the number of distinct field names is unknown. If >= 0, iterator() will return as many field names.
      • getUniqueTermCount

        @Deprecated
        public long getUniqueTermCount()
                                throws java.io.IOException
        Deprecated.
        iterate fields and add their size() instead. this method is only provided as a transition mechanism to access this statistic for 3.x indexes, which do not have this statistic per-field.
        Returns the number of terms for all fields, or -1 if this measure isn't stored by the codec. Note that, just like other term measures, this measure does not take deleted documents into account.
        Throws:
        java.io.IOException
        See Also:
        Terms.size()