Class NestPathField


public class NestPathField extends StrField
To be used for field IndexSchema.NEST_PATH_FIELD_NAME for enhanced nested doc information. By defining a field type, we can encapsulate the configuration here so that the schema is free of it. Alternatively, some notion of "implicit field types" would be cool and a more general way of accomplishing this.
Since:
8.0
See Also:
  • Constructor Details

    • NestPathField

      public NestPathField()
  • Method Details

    • setArgs

      public void setArgs(IndexSchema schema, Map<String,String> args)
      Description copied from class: FieldType
      Initializes the field type. Subclasses should usually override FieldType.init(IndexSchema, Map) which is called by this method.
      Overrides:
      setArgs in class FieldType
    • createFields

      public List<org.apache.lucene.index.IndexableField> createFields(SchemaField field, Object value)
      Given a SchemaField, create one or more IndexableField instances Overridden to manipulate the indexed form (AKA terms), but not the DV form. The value may look something like /childA#0/childB#23 and we want to strip out the pound-digits aspects.

      The terms index is used for block-join and docValues is used for returning nested docs in the same structure as given.

      Overrides:
      createFields in class StrField
      Parameters:
      field - the SchemaField
      value - The value to add to the field
      Returns:
      An array of IndexableField
      See Also:
    • toInternal

      public String toInternal(String val)
      Description copied from class: FieldType
      Convert an external value (from XML update command or from query string) into the internal format for both storing and indexing (which can be modified by any analyzers).
      Overrides:
      toInternal in class FieldType
      See Also:
    • getFieldQuery

      public org.apache.lucene.search.Query getFieldQuery(QParser parser, SchemaField field, String externalVal)
      Description copied from class: FieldType
      Returns a Query instance for doing searches against a field.
      Overrides:
      getFieldQuery in class FieldType
      Parameters:
      parser - The QParser calling the method
      field - The SchemaField of the field to search
      externalVal - The String representation of the value to search
      Returns:
      The Query instance. This implementation returns a TermQuery but overriding queries may not