CustomAnalyzer Class
- java.
lang. Object - com.
azure. search. documents. indexes. models. LexicalAnalyzer - com.
azure. search. documents. indexes. models. CustomAnalyzer
- com.
- com.
public final class CustomAnalyzer
extends 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
| Constructor | Description |
|---|---|
| CustomAnalyzer(String name, LexicalTokenizerName tokenizer) |
Creates an instance of Custom |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Custom |
fromJson(JsonReader jsonReader)
Reads an instance of Custom |
|
List<Char |
getCharFilters()
Get the char |
| String |
getOdataType()
Get the odata |
|
List<Token |
getTokenFilters()
Get the token |
|
Lexical |
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. |
|
Custom |
setCharFilters(CharFilterName[] charFilters)
Set the char |
|
Custom |
setCharFilters(List<CharFilterName> charFilters)
Set the char |
|
Custom |
setTokenFilters(List<TokenFilterName> tokenFilters)
Set the token |
|
Custom |
setTokenFilters(TokenFilterName[] tokenFilters)
Set the token |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from LexicalAnalyzer
Methods inherited from java.lang.Object
Constructor Details
CustomAnalyzer
public CustomAnalyzer(String name, LexicalTokenizerName tokenizer)
Creates an instance of CustomAnalyzer class.
Parameters:
Method Details
fromJson
public static CustomAnalyzer fromJson(JsonReader jsonReader)
Reads an instance of CustomAnalyzer from the JsonReader.
Parameters:
Returns:
Throws:
getCharFilters
public List<CharFilterName> 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:
getOdataType
public String getOdataType()
Get the odataType property: A URI fragment specifying the type of analyzer.
Overrides:
CustomAnalyzer.getOdataType()Returns:
getTokenFilters
public List<TokenFilterName> 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:
getTokenizer
public LexicalTokenizerName 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:
setCharFilters
public CustomAnalyzer setCharFilters(CharFilterName[] charFilters)
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:
Returns:
setCharFilters
public CustomAnalyzer 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. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed.
Parameters:
Returns:
setTokenFilters
public CustomAnalyzer 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. 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:
Returns:
setTokenFilters
public CustomAnalyzer setTokenFilters(TokenFilterName[] tokenFilters)
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:
Returns:
toJson
public JsonWriter toJson(JsonWriter jsonWriter)
Overrides:
CustomAnalyzer.toJson(JsonWriter jsonWriter)Parameters:
Throws: