org.hibernate.search.elasticsearch.bridge.spi

## Class Elasticsearch

- java.lang.Object
- - org.hibernate.search.elasticsearch.bridge.spi.Elasticsearch

- All Implemented Interfaces:
    FieldMetadataCreationContext

      public class Elasticsearch
      extends Object
      implements FieldMetadataCreationContext

  Extends `FieldMetadataCreationContext` allowing the user to define additional properties for a field specific to Elasticsearch.
  Author:
    Davide D'Alto
  Experimental
    This contract is currently under active development and may be altered in future releases,

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Elasticsearch(BridgeDefinedField definedField, FieldMetadataCreationContext creationContext)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Elasticsearch` | `dynamic(DynamicType dynamicType)` The dynamic type of the field, overrides the global configuration.
    `FieldMetadataCreationContext` | `field(String name, FieldType type)` Adds a field to the list of all meta-data.
    `<T extends FieldMetadataCreationContext> T` | `mappedOn(Class<T> backendType)` Gives access to properties that are specific to an indexing technology.
    `FieldMetadataCreationContext` | `sortable(boolean sortable)` Marks the last added field as sortable.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Elasticsearch

          public Elasticsearch(BridgeDefinedField definedField,
                               FieldMetadataCreationContext creationContext)

  - ### Method Detail

    - #### field

          public FieldMetadataCreationContext field(String name,
                                                    FieldType type)

      Description copied from interface: `FieldMetadataCreationContext`
      Adds a field to the list of all meta-data.
      Specified by:
        `field` in interface `FieldMetadataCreationContext`
      Parameters:
        `name` - The name of the field
        `type` - The type of the field; The type of the field created in `FieldBridge.set(String, Object, org.apache.lucene.document.Document, org.hibernate.search.bridge.LuceneOptions)` must match the type declared for the field here.
      Returns:
        a context object for fluent API invocations

    - #### sortable

          public FieldMetadataCreationContext sortable(boolean sortable)

      Description copied from interface: `FieldMetadataCreationContext`
      Marks the last added field as sortable.
      Specified by:
        `sortable` in interface `FieldMetadataCreationContext`
      Parameters:
        `sortable` - whether the last added field is sortable or not.
      Returns:
        this context for fluent API invocations

    - #### mappedOn

          public <T extends FieldMetadataCreationContext> T mappedOn(Class<T> backendType)

      Description copied from interface: `FieldMetadataCreationContext`
      Gives access to properties that are specific to an indexing technology.
      Specified by:
        `mappedOn` in interface `FieldMetadataCreationContext`
      Parameters:
        `backendType` - the selected index technology.
      Returns:
        the context for the fluent API related to the select backend.

    - #### dynamic

          public Elasticsearch dynamic(DynamicType dynamicType)

      The dynamic type of the field, overrides the global configuration.

      For more details: `DynamicType`

      Parameters:
        `dynamicType` - the dynamic value for the field
      Returns:
        the context for the fluent API

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved