Interface OpenSearchIndexSettingsConfigurer

All Superinterfaces:
IndexSettingsConfigurer<OpenSearchIndexSettingsConfigurationContext>
All Known Implementing Classes:
OpenSearchExtendedIndexSettingsConfigurer

public interface OpenSearchIndexSettingsConfigurer extends IndexSettingsConfigurer<OpenSearchIndexSettingsConfigurationContext>
Base interface for configurers of OpenSearch index settings.

Create Spring Bean that implements this interface. Index settings can be configured inside configure(OpenSearchIndexSettingsConfigurationContext) by using settings and analysis builders acquired from OpenSearchIndexSettingsConfigurationContext.

Example:

 @Component("demo_OpenSearchIndexSettingsConfigurer")
 public class DemoOpenSearchIndexSettingsConfigurer implements OpenSearchIndexSettingsConfigurer {

     @Override
     public void configure(OpenSearchIndexSettingsConfigurationContext context) {
         context.getCommonIndexSettingsBuilder().maxResultWindow(15000);
         context.getEntityIndexSettingsBuilder(Person.class).maxResultWindow(20000);

         context.getCommonAnalysisBuilder().analyzer("customized_standard", analyzerBuilder ->
                 analyzerBuilder.standard(stdAnalyzerBuilder ->
                         stdAnalyzerBuilder.maxTokenLength(100)
                 )
         );
         context.getEntityAnalysisBuilder(Person.class).analyzer("customized_standard", analyzerBuilder ->
                 analyzerBuilder.standard(stdAnalyzerBuilder ->
                         stdAnalyzerBuilder.maxTokenLength(150)
                 )
         );
     }
 }