Class AnalyzeRequest

java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.indices.AnalyzeRequest
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class AnalyzeRequest extends RequestBase implements JsonpSerializable
Get tokens from text analysis. The analyze API performs analysis on a text string and returns the resulting tokens.

Generating excessive amount of tokens may cause a node to run out of memory. The index.analyze.max_token_count setting enables you to limit the number of tokens that can be produced. If more than this limit of tokens gets generated, an error occurs. The _analyze endpoint without a specified index will always use 10000 as its limit.

See Also:
  • Field Details

  • Method Details

    • of

    • analyzer

      @Nullable public final String analyzer()
      The name of the analyzer that should be applied to the provided text. This could be a built-in analyzer, or an analyzer that’s been configured in the index.

      API name: analyzer

    • attributes

      public final List<String> attributes()
      Array of token attributes used to filter the output of the explain parameter.

      API name: attributes

    • charFilter

      public final List<CharFilter> charFilter()
      Array of character filters used to preprocess characters before the tokenizer.

      API name: char_filter

    • explain

      @Nullable public final Boolean explain()
      If true, the response includes token attributes and additional details.

      API name: explain

    • field

      @Nullable public final String field()
      Field used to derive the analyzer. To use this parameter, you must specify an index. If specified, the analyzer parameter overrides this value.

      API name: field

    • filter

      public final List<TokenFilter> filter()
      Array of token filters used to apply after the tokenizer.

      API name: filter

    • index

      @Nullable public final String index()
      Index used to derive the analyzer. If specified, the analyzer or field parameter overrides this value. If no index is specified or the index does not have a default analyzer, the analyze API uses the standard analyzer.

      API name: index

    • normalizer

      @Nullable public final String normalizer()
      Normalizer to use to convert text into a single token.

      API name: normalizer

    • text

      public final List<String> text()
      Text to analyze. If an array of strings is provided, it is analyzed as a multi-value field.

      API name: text

    • tokenizer

      @Nullable public final Tokenizer tokenizer()
      Tokenizer to use to convert text into tokens.

      API name: tokenizer

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • setupAnalyzeRequestDeserializer

      protected static void setupAnalyzeRequestDeserializer(ObjectDeserializer<AnalyzeRequest.Builder> op)