Class CustomAnalyzer
java.lang.Object
com.azure.search.documents.indexes.models.LexicalAnalyzer
com.azure.search.documents.indexes.models.CustomAnalyzer
- All Implemented Interfaces:
com.azure.json.JsonSerializable<LexicalAnalyzer>
Allows you to take control over the process of converting text into indexable/searchable tokens. It's a user-defined
configuration consisting of a single predefined tokenizer and one or more filters. The tokenizer is responsible for
breaking text into tokens, and the filters for modifying tokens emitted by the tokenizer.
-
Constructor Summary
ConstructorsConstructorDescriptionCustomAnalyzer(String name, LexicalTokenizerName tokenizer) Creates an instance of CustomAnalyzer class. -
Method Summary
Modifier and TypeMethodDescriptionstatic CustomAnalyzerfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of CustomAnalyzer from the JsonReader.Get the charFilters property: A list of character filters used to prepare input text before it is processed by the tokenizer.Get the odataType property: A URI fragment specifying the type of analyzer.Get the tokenFilters property: A list of token filters used to filter out or modify the tokens generated by a tokenizer.Get the tokenizer property: The name of the tokenizer to use to divide continuous text into a sequence of tokens, such as breaking a sentence into words.setCharFilters(CharFilterName... charFilters) Set the charFilters property: A list of character filters used to prepare input text before it is processed by the tokenizer.setCharFilters(List<CharFilterName> charFilters) Set the charFilters property: A list of character filters used to prepare input text before it is processed by the tokenizer.setTokenFilters(TokenFilterName... tokenFilters) Set the tokenFilters property: A list of token filters used to filter out or modify the tokens generated by a tokenizer.setTokenFilters(List<TokenFilterName> tokenFilters) Set the tokenFilters property: A list of token filters used to filter out or modify the tokens generated by a tokenizer.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class com.azure.search.documents.indexes.models.LexicalAnalyzer
getNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
CustomAnalyzer
Creates an instance of CustomAnalyzer class.- Parameters:
name- the name value to set.tokenizer- the tokenizer value to set.
-
-
Method Details
-
getOdataType
Get the odataType property: A URI fragment specifying the type of analyzer.- Overrides:
getOdataTypein classLexicalAnalyzer- Returns:
- the odataType value.
-
getTokenizer
Get the tokenizer property: The name of the tokenizer to use to divide continuous text into a sequence of tokens, such as breaking a sentence into words.- Returns:
- the tokenizer value.
-
getTokenFilters
Get the tokenFilters property: A list of token filters used to filter out or modify the tokens generated by a tokenizer. 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.
-
setTokenFilters
Set the tokenFilters property: A list of token filters used to filter out or modify the tokens generated by a tokenizer. 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 CustomAnalyzer object itself.
-
getCharFilters
Get the charFilters property: A list of character filters used to prepare input text before it is processed by the tokenizer. 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.
-
setCharFilters
Set the charFilters property: A list of character filters used to prepare input text before it is processed by the tokenizer. 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 CustomAnalyzer object itself.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<LexicalAnalyzer>- Overrides:
toJsonin classLexicalAnalyzer- Throws:
IOException
-
fromJson
Reads an instance of CustomAnalyzer from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of CustomAnalyzer if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the CustomAnalyzer.
-
setTokenFilters
Set the tokenFilters property: A list of token filters used to filter out or modify the tokens generated by a tokenizer. 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 CustomAnalyzer object itself.
-
setCharFilters
Set the charFilters property: A list of character filters used to prepare input text before it is processed by the tokenizer. 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 CustomAnalyzer object itself.
-