Share via


CustomNormalizer Class

public final class CustomNormalizer
extends LexicalNormalizer

Allows you to configure normalization for filterable, sortable, and facetable fields, which by default operate with strict matching. This is a user-defined configuration consisting of at least one or more filters, which modify the token that is stored.

Constructor Summary

Constructor Description
CustomNormalizer(String name)

Creates an instance of CustomNormalizer class.

Method Summary

Modifier and Type Method and Description
static CustomNormalizer fromJson(JsonReader jsonReader)

Reads an instance of CustomNormalizer from the JsonReader.

List<CharFilterName> getCharFilters()

Get the charFilters property: A list of character filters used to prepare input text before it is processed.

String getOdataType()

Get the odataType property: A URI fragment specifying the type of normalizer.

List<TokenFilterName> getTokenFilters()

Get the tokenFilters property: A list of token filters used to filter out or modify the input token.

CustomNormalizer setCharFilters(List<CharFilterName> charFilters)

Set the charFilters property: A list of character filters used to prepare input text before it is processed.

CustomNormalizer setTokenFilters(List<TokenFilterName> tokenFilters)

Set the tokenFilters property: A list of token filters used to filter out or modify the input token.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from LexicalNormalizer

Methods inherited from java.lang.Object

Constructor Details

CustomNormalizer

public CustomNormalizer(String name)

Creates an instance of CustomNormalizer class.

Parameters:

name - the name value to set.

Method Details

fromJson

public static CustomNormalizer fromJson(JsonReader jsonReader)

Reads an instance of CustomNormalizer from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of CustomNormalizer if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getCharFilters

public List<CharFilterName> getCharFilters()

Get the charFilters property: A list of character filters used to prepare input text before it is processed. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed.

Returns:

the charFilters value.

getOdataType

public String getOdataType()

Get the odataType property: A URI fragment specifying the type of normalizer.

Overrides:

CustomNormalizer.getOdataType()

Returns:

the odataType value.

getTokenFilters

public List<TokenFilterName> getTokenFilters()

Get the tokenFilters property: A list of token filters used to filter out or modify the input token. For example, you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in which they are listed.

Returns:

the tokenFilters value.

setCharFilters

public CustomNormalizer setCharFilters(List<CharFilterName> charFilters)

Set the charFilters property: A list of character filters used to prepare input text before it is processed. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed.

Parameters:

charFilters - the charFilters value to set.

Returns:

the CustomNormalizer object itself.

setTokenFilters

public CustomNormalizer setTokenFilters(List<TokenFilterName> tokenFilters)

Set the tokenFilters property: A list of token filters used to filter out or modify the input token. For example, you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in which they are listed.

Parameters:

tokenFilters - the tokenFilters value to set.

Returns:

the CustomNormalizer object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

CustomNormalizer.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to