PatternAnalyzer Class
- java.
lang. Object - com.
azure. search. documents. indexes. models. LexicalAnalyzer - com.
azure. search. documents. indexes. models. PatternAnalyzer
- com.
- com.
public final class PatternAnalyzer
extends LexicalAnalyzer
Flexibly separates text into terms via a regular expression pattern. This analyzer is implemented using Apache Lucene.
Constructor Summary
| Constructor | Description |
|---|---|
| PatternAnalyzer(String name) |
Creates an instance of Pattern |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| Boolean |
areLowerCaseTerms()
Get the lower |
|
static
Pattern |
fromJson(JsonReader jsonReader)
Reads an instance of Pattern |
|
List<Regex |
getFlags()
Get the flags property: Regular expression flags. |
| String |
getOdataType()
Get the odata |
| String |
getPattern()
Get the pattern property: A regular expression pattern to match token separators. |
| List<String> |
getStopwords()
Get the stopwords property: A list of stopwords. |
|
Pattern |
setFlags(List<RegexFlags> flags)
Set the flags property: Regular expression flags. |
|
Pattern |
setFlags(RegexFlags[] flags)
Set the flags property: Regular expression flags. |
|
Pattern |
setLowerCaseTerms(Boolean lowerCaseTerms)
Set the lower |
|
Pattern |
setPattern(String pattern)
Set the pattern property: A regular expression pattern to match token separators. |
|
Pattern |
setStopwords(List<String> stopwords)
Set the stopwords property: A list of stopwords. |
|
Pattern |
setStopwords(String[] stopwords)
Set the stopwords property: A list of stopwords. |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from LexicalAnalyzer
Methods inherited from java.lang.Object
Constructor Details
PatternAnalyzer
public PatternAnalyzer(String name)
Creates an instance of PatternAnalyzer class.
Parameters:
Method Details
areLowerCaseTerms
public Boolean areLowerCaseTerms()
Get the lowerCaseTerms property: A value indicating whether terms should be lower-cased. Default is true.
Returns:
fromJson
public static PatternAnalyzer fromJson(JsonReader jsonReader)
Reads an instance of PatternAnalyzer from the JsonReader.
Parameters:
Returns:
Throws:
getFlags
public List<RegexFlags> getFlags()
Get the flags property: Regular expression flags.
Returns:
getOdataType
public String getOdataType()
Get the odataType property: A URI fragment specifying the type of analyzer.
Overrides:
PatternAnalyzer.getOdataType()Returns:
getPattern
public String 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:
getStopwords
public List<String> getStopwords()
Get the stopwords property: A list of stopwords.
Returns:
setFlags
public PatternAnalyzer setFlags(List<RegexFlags> flags)
Set the flags property: Regular expression flags.
Parameters:
Returns:
setFlags
public PatternAnalyzer setFlags(RegexFlags[] flags)
Set the flags property: Regular expression flags.
Parameters:
Returns:
setLowerCaseTerms
public PatternAnalyzer setLowerCaseTerms(Boolean lowerCaseTerms)
Set the lowerCaseTerms property: A value indicating whether terms should be lower-cased. Default is true.
Parameters:
Returns:
setPattern
public PatternAnalyzer setPattern(String pattern)
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:
Returns:
setStopwords
public PatternAnalyzer setStopwords(List<String> stopwords)
Set the stopwords property: A list of stopwords.
Parameters:
Returns:
setStopwords
public PatternAnalyzer setStopwords(String[] stopwords)
Set the stopwords property: A list of stopwords.
Parameters:
Returns:
toJson
public JsonWriter toJson(JsonWriter jsonWriter)
Overrides:
PatternAnalyzer.toJson(JsonWriter jsonWriter)Parameters:
Throws: