Class ParseContext.Document

  • All Implemented Interfaces:
    java.lang.Iterable<org.apache.lucene.index.IndexableField>
    Enclosing class:
    ParseContext

    public static class ParseContext.Document
    extends java.lang.Object
    implements java.lang.Iterable<org.apache.lucene.index.IndexableField>
    Fork of Document with additional functionality.
    • Constructor Summary

      Constructors 
      Constructor Description
      Document()  
    • Method Summary

      Modifier and Type Method Description
      void add​(org.apache.lucene.index.IndexableField field)  
      void addWithKey​(java.lang.Object key, org.apache.lucene.index.IndexableField field)
      Add fields so that they can later be fetched using getByKey(Object).
      java.lang.String get​(java.lang.String name)  
      org.apache.lucene.util.BytesRef getBinaryValue​(java.lang.String name)  
      org.apache.lucene.index.IndexableField getByKey​(java.lang.Object key)
      Get back fields that have been previously added with addWithKey(Object, IndexableField).
      org.apache.lucene.index.IndexableField getField​(java.lang.String name)  
      java.util.List<org.apache.lucene.index.IndexableField> getFields()  
      org.apache.lucene.index.IndexableField[] getFields​(java.lang.String name)  
      ParseContext.Document getParent()
      Return the parent document, or null if this is the root document.
      java.lang.String getPath()
      Return the path associated with this document.
      java.lang.String getPrefix()
      Return a prefix that all fields in this document should have.
      java.lang.String[] getValues​(java.lang.String name)
      Returns an array of values of the field specified as the method parameter.
      java.util.Iterator<org.apache.lucene.index.IndexableField> iterator()  
      • Methods inherited from class java.lang.Object

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

        forEach, spliterator
    • Constructor Detail

      • Document

        public Document()
    • Method Detail

      • getPath

        public java.lang.String getPath()
        Return the path associated with this document.
      • getPrefix

        public java.lang.String getPrefix()
        Return a prefix that all fields in this document should have.
      • getParent

        public ParseContext.Document getParent()
        Return the parent document, or null if this is the root document.
      • iterator

        public java.util.Iterator<org.apache.lucene.index.IndexableField> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<org.apache.lucene.index.IndexableField>
      • getFields

        public java.util.List<org.apache.lucene.index.IndexableField> getFields()
      • add

        public void add​(org.apache.lucene.index.IndexableField field)
      • addWithKey

        public void addWithKey​(java.lang.Object key,
                               org.apache.lucene.index.IndexableField field)
        Add fields so that they can later be fetched using getByKey(Object).
      • getByKey

        public org.apache.lucene.index.IndexableField getByKey​(java.lang.Object key)
        Get back fields that have been previously added with addWithKey(Object, IndexableField).
      • getFields

        public org.apache.lucene.index.IndexableField[] getFields​(java.lang.String name)
      • getValues

        public final java.lang.String[] getValues​(java.lang.String name)
        Returns an array of values of the field specified as the method parameter. This method returns an empty array when there are no matching fields. It never returns null. If you want the actual numeric field instances back, use getFields().
        Parameters:
        name - the name of the field
        Returns:
        a String[] of field values
      • getField

        public org.apache.lucene.index.IndexableField getField​(java.lang.String name)
      • get

        public java.lang.String get​(java.lang.String name)
      • getBinaryValue

        public org.apache.lucene.util.BytesRef getBinaryValue​(java.lang.String name)