Class LazyDocument.LazyField

java.lang.Object
org.apache.lucene.misc.document.LazyDocument.LazyField
All Implemented Interfaces:
IndexableField
Enclosing class:
LazyDocument

public class LazyDocument.LazyField extends Object implements IndexableField
Lazy-loaded field
  • Field Details

    • name

      private String name
    • fieldNum

      private int fieldNum
    • realValue

      volatile IndexableField realValue
  • Constructor Details

    • LazyField

      private LazyField(String name, int fieldNum)
  • Method Details

    • hasBeenLoaded

      public boolean hasBeenLoaded()
      non-private for test only access
    • getRealValue

      private IndexableField getRealValue()
    • name

      public String name()
      Description copied from interface: IndexableField
      Field name
      Specified by:
      name in interface IndexableField
    • binaryValue

      public BytesRef binaryValue()
      Description copied from interface: IndexableField
      Non-null if this field has a binary value
      Specified by:
      binaryValue in interface IndexableField
    • stringValue

      public String stringValue()
      Description copied from interface: IndexableField
      Non-null if this field has a string value
      Specified by:
      stringValue in interface IndexableField
    • readerValue

      public Reader readerValue()
      Description copied from interface: IndexableField
      Non-null if this field has a Reader value
      Specified by:
      readerValue in interface IndexableField
    • numericValue

      public Number numericValue()
      Description copied from interface: IndexableField
      Non-null if this field has a numeric value
      Specified by:
      numericValue in interface IndexableField
    • fieldType

      public IndexableFieldType fieldType()
      Description copied from interface: IndexableField
      IndexableFieldType describing the properties of this field.
      Specified by:
      fieldType in interface IndexableField
    • tokenStream

      public TokenStream tokenStream(Analyzer analyzer, TokenStream reuse)
      Description copied from interface: IndexableField
      Creates the TokenStream used for indexing this field. If appropriate, implementations should use the given Analyzer to create the TokenStreams.
      Specified by:
      tokenStream in interface IndexableField
      Parameters:
      analyzer - Analyzer that should be used to create the TokenStreams from
      reuse - TokenStream for a previous instance of this field name. This allows custom field types (like StringField and NumericField) that do not use the analyzer to still have good performance. Note: the passed-in type may be inappropriate, for example if you mix up different types of Fields for the same field name. So it's the responsibility of the implementation to check.
      Returns:
      TokenStream value for indexing the document. Should always return a non-null value if the field is to be indexed