Class AnalyzeRequest

java.lang.Object
org.elasticsearch.client.indices.AnalyzeRequest
All Implemented Interfaces:
Validatable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public class AnalyzeRequest extends Object implements Validatable, org.elasticsearch.xcontent.ToXContentObject
A request to analyze text
  • Method Details

    • withGlobalAnalyzer

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

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

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

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

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

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

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

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

      public static AnalyzeRequest.CustomAnalyzerBuilder buildCustomNormalizer()
      Analyzes text using a custom normalizer built from global components
    • buildCustomNormalizer

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

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

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

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

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

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

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

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

      public 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(String... attributes)
    • attributes

      public String[] attributes()
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException