Class PatternTokenizer
java.lang.Object
com.azure.search.documents.indexes.models.LexicalTokenizer
com.azure.search.documents.indexes.models.PatternTokenizer
- All Implemented Interfaces:
com.azure.json.JsonSerializable<LexicalTokenizer>
Tokenizer that uses regex pattern matching to construct distinct tokens. This tokenizer is implemented using Apache
Lucene.
-
Constructor Summary
ConstructorsConstructorDescriptionPatternTokenizer(String name) Creates an instance of PatternTokenizer class. -
Method Summary
Modifier and TypeMethodDescriptionstatic PatternTokenizerfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of PatternTokenizer from the JsonReader.getFlags()Get the flags property: Regular expression flags.getGroup()Get the group property: The zero-based ordinal of the matching group in the regular expression pattern to extract into tokens.Get the odataType property: A URI fragment specifying the type of tokenizer.Get the pattern property: A regular expression pattern to match token separators.setFlags(RegexFlags... flags) Set the flags property: Regular expression flags.setFlags(List<RegexFlags> flags) Set the flags property: Regular expression flags.Set the group property: The zero-based ordinal of the matching group in the regular expression pattern to extract into tokens.setPattern(String pattern) Set the pattern property: A regular expression pattern to match token separators.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class com.azure.search.documents.indexes.models.LexicalTokenizer
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
-
PatternTokenizer
Creates an instance of PatternTokenizer class.- Parameters:
name- the name value to set.
-
-
Method Details
-
getOdataType
Get the odataType property: A URI fragment specifying the type of tokenizer.- Overrides:
getOdataTypein classLexicalTokenizer- Returns:
- the odataType value.
-
getPattern
Get the pattern property: A regular expression pattern to match token separators. Default is an expression that matches one or more non-word characters.- Returns:
- the pattern value.
-
setPattern
Set the pattern property: A regular expression pattern to match token separators. Default is an expression that matches one or more non-word characters.- Parameters:
pattern- the pattern value to set.- Returns:
- the PatternTokenizer object itself.
-
getFlags
Get the flags property: Regular expression flags.- Returns:
- the flags value.
-
setFlags
Set the flags property: Regular expression flags.- Parameters:
flags- the flags value to set.- Returns:
- the PatternTokenizer object itself.
-
getGroup
Get the group property: The zero-based ordinal of the matching group in the regular expression pattern to extract into tokens. Use -1 if you want to use the entire pattern to split the input into tokens, irrespective of matching groups. Default is -1.- Returns:
- the group value.
-
setGroup
Set the group property: The zero-based ordinal of the matching group in the regular expression pattern to extract into tokens. Use -1 if you want to use the entire pattern to split the input into tokens, irrespective of matching groups. Default is -1.- Parameters:
group- the group value to set.- Returns:
- the PatternTokenizer object itself.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<LexicalTokenizer>- Overrides:
toJsonin classLexicalTokenizer- Throws:
IOException
-
fromJson
Reads an instance of PatternTokenizer from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of PatternTokenizer 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 PatternTokenizer.
-
setFlags
Set the flags property: Regular expression flags.- Parameters:
flags- the flags value to set.- Returns:
- the PatternTokenizer object itself.
-