Class ReactiveOpenSearchConfiguration

java.lang.Object
org.springframework.data.elasticsearch.config.ElasticsearchConfigurationSupport
org.opensearch.data.client.osc.ReactiveOpenSearchConfiguration

public abstract class ReactiveOpenSearchConfiguration extends org.springframework.data.elasticsearch.config.ElasticsearchConfigurationSupport
Base class for a @Configuration class to set up the OpenSearch connection using the ReactiveOpenSearchClient. This class exposes different parts of the setup as Spring beans. Deriving * classes must provide the ClientConfiguration to use.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.springframework.data.elasticsearch.client.ClientConfiguration
    Must be implemented by deriving classes to provide the ClientConfiguration.
    org.opensearch.client.RestClient
    elasticsearchRestClient(org.springframework.data.elasticsearch.client.ClientConfiguration clientConfiguration)
    Provides the underlying low level RestClient.
    org.opensearch.client.json.JsonpMapper
    Provides the JsonpMapper that is used in the opensearchTransport(RestClient, JsonpMapper) method and exposes it as a bean.
    org.opensearch.client.transport.OpenSearchTransport
    opensearchTransport(org.opensearch.client.RestClient restClient, org.opensearch.client.json.JsonpMapper jsonpMapper)
    Provides the Elasticsearch transport to be used.
    org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations
    reactiveElasticsearchOperations(org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter elasticsearchConverter, ReactiveOpenSearchClient reactiveElasticsearchClient)
    Creates ReactiveElasticsearchOperations.
    reactiveOpenSearchClient(org.opensearch.client.transport.OpenSearchTransport transport)
    Provides the ReactiveOpenSearchClient instance used.
    org.opensearch.client.transport.TransportOptions
     

    Methods inherited from class org.springframework.data.elasticsearch.config.ElasticsearchConfigurationSupport

    elasticsearchCustomConversions, elasticsearchEntityMapper, elasticsearchMappingContext, fieldNamingStrategy, getInitialEntitySet, getMappingBasePackages, refreshPolicy, scanForEntities, writeTypeHints

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ReactiveOpenSearchConfiguration

      public ReactiveOpenSearchConfiguration()
  • Method Details

    • clientConfiguration

      @Bean(name="elasticsearchClientConfiguration") public abstract org.springframework.data.elasticsearch.client.ClientConfiguration clientConfiguration()
      Must be implemented by deriving classes to provide the ClientConfiguration.
      Returns:
      configuration, must not be null
    • elasticsearchRestClient

      @Bean public org.opensearch.client.RestClient elasticsearchRestClient(org.springframework.data.elasticsearch.client.ClientConfiguration clientConfiguration)
      Provides the underlying low level RestClient.
      Parameters:
      clientConfiguration - configuration for the client, must not be null
      Returns:
      RestClient
    • opensearchTransport

      @Bean public org.opensearch.client.transport.OpenSearchTransport opensearchTransport(org.opensearch.client.RestClient restClient, org.opensearch.client.json.JsonpMapper jsonpMapper)
      Provides the Elasticsearch transport to be used. The default implementation uses the RestClient bean and the JsonpMapper bean provided in this class.
      Returns:
      the OpenSearchTransport
      Since:
      5.2
    • reactiveOpenSearchClient

      @Bean public ReactiveOpenSearchClient reactiveOpenSearchClient(org.opensearch.client.transport.OpenSearchTransport transport)
      Provides the ReactiveOpenSearchClient instance used.
      Parameters:
      transport - the OpenSearchTransport to use
      Returns:
      ReactiveOpenSearchClient instance.
    • reactiveElasticsearchOperations

      @Bean(name={"reactiveElasticsearchOperations","reactiveElasticsearchTemplate","reactiveOpensearchOperations","reactiveOpensearchTemplate"}) public org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations reactiveElasticsearchOperations(org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter elasticsearchConverter, ReactiveOpenSearchClient reactiveElasticsearchClient)
      Creates ReactiveElasticsearchOperations.
      Returns:
      never null.
    • jsonpMapper

      @Bean public org.opensearch.client.json.JsonpMapper jsonpMapper()
      Provides the JsonpMapper that is used in the opensearchTransport(RestClient, JsonpMapper) method and exposes it as a bean.
      Returns:
      the JsonpMapper to use
      Since:
      5.2
    • transportOptions

      public org.opensearch.client.transport.TransportOptions transportOptions()
      Returns:
      the options that should be added to every request. Must not be null