Class AnalyzeRequest

  • All Implemented Interfaces:
    Validatable, org.opensearch.common.xcontent.ToXContent, org.opensearch.common.xcontent.ToXContentObject

    public class AnalyzeRequest
    extends java.lang.Object
    implements Validatable, org.opensearch.common.xcontent.ToXContentObject
    A request to analyze text
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  AnalyzeRequest.CustomAnalyzerBuilder
      Helper class to build custom analyzer definitions
      • Nested classes/interfaces inherited from interface org.opensearch.common.xcontent.ToXContent

        org.opensearch.common.xcontent.ToXContent.DelegatingMapParams, org.opensearch.common.xcontent.ToXContent.MapParams, org.opensearch.common.xcontent.ToXContent.Params
    • Field Summary

      • Fields inherited from interface org.opensearch.common.xcontent.ToXContent

        EMPTY_PARAMS
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String analyzer()
      Returns the named analyzer used for analysis, if defined
      java.lang.String[] attributes()  
      AnalyzeRequest attributes​(java.lang.String... attributes)  
      static AnalyzeRequest.CustomAnalyzerBuilder buildCustomAnalyzer​(java.lang.String tokenizer)
      Analyzes text using a custom analyzer built from global components
      static AnalyzeRequest.CustomAnalyzerBuilder buildCustomAnalyzer​(java.lang.String index, java.lang.String tokenizer)
      Analyzes text using a custom analyzer built from components defined on an index
      static AnalyzeRequest.CustomAnalyzerBuilder buildCustomAnalyzer​(java.lang.String index, java.util.Map<java.lang.String,​java.lang.Object> tokenizerSettings)
      Analyzes text using a custom analyzer built from components defined on an index
      static AnalyzeRequest.CustomAnalyzerBuilder buildCustomAnalyzer​(java.util.Map<java.lang.String,​java.lang.Object> tokenizerSettings)
      Analyzes text using a custom analyzer built from global components
      static AnalyzeRequest.CustomAnalyzerBuilder buildCustomNormalizer()
      Analyzes text using a custom normalizer built from global components
      static AnalyzeRequest.CustomAnalyzerBuilder buildCustomNormalizer​(java.lang.String index)
      Analyzes text using a custom normalizer built from components defined on an index
      java.util.List<org.opensearch.client.indices.AnalyzeRequest.NameOrDefinition> charFilters()
      Returns the custom character filters used for analysis, if defined
      boolean explain()  
      AnalyzeRequest explain​(boolean explain)
      Set whether or not detailed explanations of analysis should be returned
      java.lang.String field()
      Returns the field to take an Analyzer from, if defined
      java.lang.String index()
      Returns the index that the request should be executed against, or null if no index is specified
      java.lang.String normalizer()
      Returns the named tokenizer used for analysis, if defined
      java.lang.String[] text()
      Returns the text to be analyzed
      java.util.List<org.opensearch.client.indices.AnalyzeRequest.NameOrDefinition> tokenFilters()
      Returns the custom token filters used for analysis, if defined
      org.opensearch.client.indices.AnalyzeRequest.NameOrDefinition tokenizer()
      Returns a custom Tokenizer used for analysis, if defined
      org.opensearch.common.xcontent.XContentBuilder toXContent​(org.opensearch.common.xcontent.XContentBuilder builder, org.opensearch.common.xcontent.ToXContent.Params params)  
      static AnalyzeRequest withField​(java.lang.String index, java.lang.String field, java.lang.String... text)
      Analyzes text using the analyzer defined on a specific field within an index
      static AnalyzeRequest withGlobalAnalyzer​(java.lang.String analyzer, java.lang.String... text)
      Analyzes text using a global analyzer
      static AnalyzeRequest withIndexAnalyzer​(java.lang.String index, java.lang.String analyzer, java.lang.String... text)
      Analyzes text using a named analyzer on an index
      static AnalyzeRequest withNormalizer​(java.lang.String index, java.lang.String normalizer, java.lang.String... text)
      Analyzes text using a named normalizer on an index
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.opensearch.common.xcontent.ToXContentObject

        isFragment
    • Method Detail

      • withGlobalAnalyzer

        public static AnalyzeRequest withGlobalAnalyzer​(java.lang.String analyzer,
                                                        java.lang.String... text)
        Analyzes text using a global analyzer
      • buildCustomAnalyzer

        public static AnalyzeRequest.CustomAnalyzerBuilder buildCustomAnalyzer​(java.lang.String tokenizer)
        Analyzes text using a custom analyzer built from global components
      • buildCustomAnalyzer

        public static AnalyzeRequest.CustomAnalyzerBuilder buildCustomAnalyzer​(java.util.Map<java.lang.String,​java.lang.Object> tokenizerSettings)
        Analyzes text using a custom analyzer built from global components
      • buildCustomAnalyzer

        public static AnalyzeRequest.CustomAnalyzerBuilder buildCustomAnalyzer​(java.lang.String index,
                                                                               java.lang.String tokenizer)
        Analyzes text using a custom analyzer built from components defined on an index
      • buildCustomAnalyzer

        public static AnalyzeRequest.CustomAnalyzerBuilder buildCustomAnalyzer​(java.lang.String index,
                                                                               java.util.Map<java.lang.String,​java.lang.Object> tokenizerSettings)
        Analyzes text using a custom analyzer built from components defined on an index
      • withIndexAnalyzer

        public static AnalyzeRequest withIndexAnalyzer​(java.lang.String index,
                                                       java.lang.String analyzer,
                                                       java.lang.String... text)
        Analyzes text using a named analyzer on an index
      • withField

        public static AnalyzeRequest withField​(java.lang.String index,
                                               java.lang.String field,
                                               java.lang.String... text)
        Analyzes text using the analyzer defined on a specific field within an index
      • withNormalizer

        public static AnalyzeRequest withNormalizer​(java.lang.String index,
                                                    java.lang.String normalizer,
                                                    java.lang.String... text)
        Analyzes text using a named normalizer on an index
      • buildCustomNormalizer

        public static AnalyzeRequest.CustomAnalyzerBuilder buildCustomNormalizer​(java.lang.String index)
        Analyzes text using a custom normalizer built from components defined on an index
      • index

        public java.lang.String index()
        Returns the index that the request should be executed against, or null if no index is specified
      • text

        public java.lang.String[] text()
        Returns the text to be analyzed
      • analyzer

        public java.lang.String analyzer()
        Returns the named analyzer used for analysis, if defined
      • normalizer

        public java.lang.String normalizer()
        Returns the named tokenizer used for analysis, if defined
      • tokenizer

        public org.opensearch.client.indices.AnalyzeRequest.NameOrDefinition tokenizer()
        Returns a custom Tokenizer used for analysis, if defined
      • tokenFilters

        public java.util.List<org.opensearch.client.indices.AnalyzeRequest.NameOrDefinition> tokenFilters()
        Returns the custom token filters used for analysis, if defined
      • charFilters

        public java.util.List<org.opensearch.client.indices.AnalyzeRequest.NameOrDefinition> charFilters()
        Returns the custom character filters used for analysis, if defined
      • field

        public java.lang.String field()
        Returns the field to take an Analyzer from, if defined
      • explain

        public AnalyzeRequest explain​(boolean explain)
        Set whether or not detailed explanations of analysis should be returned
      • explain

        public boolean explain()
      • attributes

        public AnalyzeRequest attributes​(java.lang.String... attributes)
      • attributes

        public java.lang.String[] attributes()
      • toXContent

        public org.opensearch.common.xcontent.XContentBuilder toXContent​(org.opensearch.common.xcontent.XContentBuilder builder,
                                                                         org.opensearch.common.xcontent.ToXContent.Params params)
                                                                  throws java.io.IOException
        Specified by:
        toXContent in interface org.opensearch.common.xcontent.ToXContent
        Throws:
        java.io.IOException