Class ShingleTokenFilter
java.lang.Object
com.azure.search.documents.indexes.models.TokenFilter
com.azure.search.documents.indexes.models.ShingleTokenFilter
- All Implemented Interfaces:
com.azure.json.JsonSerializable<TokenFilter>
Creates combinations of tokens as a single token. This token filter is implemented using Apache Lucene.
-
Constructor Summary
ConstructorsConstructorDescriptionShingleTokenFilter(String name) Creates an instance of ShingleTokenFilter class. -
Method Summary
Modifier and TypeMethodDescriptionGet the outputUnigrams property: A value indicating whether the output stream will contain the input tokens (unigrams) as well as shingles.Get the outputUnigramsIfNoShingles property: A value indicating whether to output unigrams for those times when no shingles are available.static ShingleTokenFilterfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ShingleTokenFilter from the JsonReader.Get the filterToken property: The string to insert for each position at which there is no token.Get the maxShingleSize property: The maximum shingle size.Get the minShingleSize property: The minimum shingle size.Get the odataType property: A URI fragment specifying the type of token filter.Get the tokenSeparator property: The string to use when joining adjacent tokens to form a shingle.setFilterToken(String filterToken) Set the filterToken property: The string to insert for each position at which there is no token.setMaxShingleSize(Integer maxShingleSize) Set the maxShingleSize property: The maximum shingle size.setMinShingleSize(Integer minShingleSize) Set the minShingleSize property: The minimum shingle size.setOutputUnigrams(Boolean outputUnigrams) Set the outputUnigrams property: A value indicating whether the output stream will contain the input tokens (unigrams) as well as shingles.setOutputUnigramsIfNoShingles(Boolean outputUnigramsIfNoShingles) Set the outputUnigramsIfNoShingles property: A value indicating whether to output unigrams for those times when no shingles are available.setTokenSeparator(String tokenSeparator) Set the tokenSeparator property: The string to use when joining adjacent tokens to form a shingle.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class com.azure.search.documents.indexes.models.TokenFilter
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
-
ShingleTokenFilter
Creates an instance of ShingleTokenFilter class.- Parameters:
name- the name value to set.
-
-
Method Details
-
getOdataType
Get the odataType property: A URI fragment specifying the type of token filter.- Overrides:
getOdataTypein classTokenFilter- Returns:
- the odataType value.
-
getMaxShingleSize
Get the maxShingleSize property: The maximum shingle size. Default and minimum value is 2.- Returns:
- the maxShingleSize value.
-
setMaxShingleSize
Set the maxShingleSize property: The maximum shingle size. Default and minimum value is 2.- Parameters:
maxShingleSize- the maxShingleSize value to set.- Returns:
- the ShingleTokenFilter object itself.
-
getMinShingleSize
Get the minShingleSize property: The minimum shingle size. Default and minimum value is 2. Must be less than the value of maxShingleSize.- Returns:
- the minShingleSize value.
-
setMinShingleSize
Set the minShingleSize property: The minimum shingle size. Default and minimum value is 2. Must be less than the value of maxShingleSize.- Parameters:
minShingleSize- the minShingleSize value to set.- Returns:
- the ShingleTokenFilter object itself.
-
areOutputUnigrams
Get the outputUnigrams property: A value indicating whether the output stream will contain the input tokens (unigrams) as well as shingles. Default is true.- Returns:
- the outputUnigrams value.
-
setOutputUnigrams
Set the outputUnigrams property: A value indicating whether the output stream will contain the input tokens (unigrams) as well as shingles. Default is true.- Parameters:
outputUnigrams- the outputUnigrams value to set.- Returns:
- the ShingleTokenFilter object itself.
-
areOutputUnigramsIfNoShingles
Get the outputUnigramsIfNoShingles property: A value indicating whether to output unigrams for those times when no shingles are available. This property takes precedence when outputUnigrams is set to false. Default is false.- Returns:
- the outputUnigramsIfNoShingles value.
-
setOutputUnigramsIfNoShingles
Set the outputUnigramsIfNoShingles property: A value indicating whether to output unigrams for those times when no shingles are available. This property takes precedence when outputUnigrams is set to false. Default is false.- Parameters:
outputUnigramsIfNoShingles- the outputUnigramsIfNoShingles value to set.- Returns:
- the ShingleTokenFilter object itself.
-
getTokenSeparator
Get the tokenSeparator property: The string to use when joining adjacent tokens to form a shingle. Default is a single space (" ").- Returns:
- the tokenSeparator value.
-
setTokenSeparator
Set the tokenSeparator property: The string to use when joining adjacent tokens to form a shingle. Default is a single space (" ").- Parameters:
tokenSeparator- the tokenSeparator value to set.- Returns:
- the ShingleTokenFilter object itself.
-
getFilterToken
Get the filterToken property: The string to insert for each position at which there is no token. Default is an underscore ("_").- Returns:
- the filterToken value.
-
setFilterToken
Set the filterToken property: The string to insert for each position at which there is no token. Default is an underscore ("_").- Parameters:
filterToken- the filterToken value to set.- Returns:
- the ShingleTokenFilter object itself.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<TokenFilter>- Overrides:
toJsonin classTokenFilter- Throws:
IOException
-
fromJson
Reads an instance of ShingleTokenFilter from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of ShingleTokenFilter 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 ShingleTokenFilter.
-