Share via


KeywordTokenizer Class

public final class KeywordTokenizer
extends LexicalTokenizer

Emits the entire input as a single token. This tokenizer is implemented using Apache Lucene.

Constructor Summary

Constructor Description
KeywordTokenizer(String name)

Constructor of KeywordTokenizer.

Method Summary

Modifier and Type Method and Description
Integer getMaxTokenLength()

Get the maxTokenLength property: The maximum token length.

KeywordTokenizer setMaxTokenLength(Integer maxTokenLength)

Set the maxTokenLength property: The maximum token length.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from LexicalTokenizer

Methods inherited from java.lang.Object

Constructor Details

KeywordTokenizer

public KeywordTokenizer(String name)

Constructor of KeywordTokenizer.

Parameters:

name - The name of the tokenizer. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters.

Method Details

getMaxTokenLength

public Integer getMaxTokenLength()

Get the maxTokenLength property: The maximum token length. Default is 256. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters.

Returns:

the maxTokenLength value.

setMaxTokenLength

public KeywordTokenizer setMaxTokenLength(Integer maxTokenLength)

Set the maxTokenLength property: The maximum token length. Default is 256. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters.

Parameters:

maxTokenLength - the maxTokenLength value to set.

Returns:

the KeywordTokenizerV2 object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

KeywordTokenizer.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to