org.hibernate.search.elasticsearch.schema.impl

## Class DefaultElasticsearchSchemaCreator

- java.lang.Object
- - org.hibernate.search.elasticsearch.schema.impl.DefaultElasticsearchSchemaCreator

- All Implemented Interfaces:
    ElasticsearchSchemaCreator

      public class DefaultElasticsearchSchemaCreator
      extends Object
      implements ElasticsearchSchemaCreator

  The default `ElasticsearchSchemaCreator` implementation.
  Author:
    Gunnar Morling, Yoann Rodiere

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultElasticsearchSchemaCreator(ElasticsearchSchemaAccessor schemaAccessor)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkIndexExists(URLEncodedString indexName, ExecutionOptions executionOptions)` Checks that an index already exists.
    `void` | `createIndex(IndexMetadata indexMetadata, ExecutionOptions executionOptions)` Create an index.
    `boolean` | `createIndexIfAbsent(IndexMetadata indexMetadata, ExecutionOptions executionOptions)` Create an index, but only if the index doesn't already exist.
    `void` | `createMappings(IndexMetadata indexMetadata, ExecutionOptions executionOptions)` Create mappings on a supposedly existing index.

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

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

- - ### Constructor Detail

    - #### DefaultElasticsearchSchemaCreator

          public DefaultElasticsearchSchemaCreator(ElasticsearchSchemaAccessor schemaAccessor)

  - ### Method Detail

    - #### createIndex

          public void createIndex(IndexMetadata indexMetadata,
                                  ExecutionOptions executionOptions)

      Description copied from interface: `ElasticsearchSchemaCreator`
      Create an index.
      Specified by:
        `createIndex` in interface `ElasticsearchSchemaCreator`
      Parameters:
        `indexMetadata` - The expected index metadata.
        `executionOptions` - The execution options, giving more context information.

    - #### createIndexIfAbsent

          public boolean createIndexIfAbsent(IndexMetadata indexMetadata,
                                             ExecutionOptions executionOptions)

      Description copied from interface: `ElasticsearchSchemaCreator`
      Create an index, but only if the index doesn't already exist.
      Specified by:
        `createIndexIfAbsent` in interface `ElasticsearchSchemaCreator`
      Parameters:
        `indexMetadata` - The expected index metadata.
        `executionOptions` - The execution options, giving more context information.
      Returns:
        `true` if the index had to be created, `false` otherwise.

    - #### checkIndexExists

          public void checkIndexExists(URLEncodedString indexName,
                                       ExecutionOptions executionOptions)

      Description copied from interface: `ElasticsearchSchemaCreator`
      Checks that an index already exists.
      Specified by:
        `checkIndexExists` in interface `ElasticsearchSchemaCreator`
      Parameters:
        `indexName` - The expected index name.
        `executionOptions` - The execution options, giving more context information.

    - #### createMappings

          public void createMappings(IndexMetadata indexMetadata,
                                     ExecutionOptions executionOptions)

      Description copied from interface: `ElasticsearchSchemaCreator`
      Create mappings on a supposedly existing index.

      Mappings are supposed to be absent from the index.

      Specified by:
        `createMappings` in interface `ElasticsearchSchemaCreator`
      Parameters:
        `indexMetadata` - The expected index metadata.
        `executionOptions` - The execution options, giving more context information.

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