EdgeNGramTokenFilterV2 Class

public final class EdgeNGramTokenFilterV2
extends TokenFilter

Generates n-grams of the given size(s) starting from the front or the back of an input token. This token filter is implemented using Apache Lucene.

Constructor Summary

Constructor Description
EdgeNGramTokenFilterV2(String name)

Creates an instance of EdgeNGramTokenFilterV2 class.

Method Summary

Modifier and Type Method and Description
static EdgeNGramTokenFilterV2 fromJson(JsonReader jsonReader)

Reads an instance of EdgeNGramTokenFilterV2 from the JsonReader.

Integer getMaxGram()

Get the maxGram property: The maximum n-gram length.

Integer getMinGram()

Get the minGram property: The minimum n-gram length.

String getOdataType()

Get the odataType property: The discriminator for derived types.

EdgeNGramTokenFilterSide getSide()

Get the side property: Specifies which side of the input the n-gram should be generated from.

EdgeNGramTokenFilterV2 setMaxGram(Integer maxGram)

Set the maxGram property: The maximum n-gram length.

EdgeNGramTokenFilterV2 setMinGram(Integer minGram)

Set the minGram property: The minimum n-gram length.

EdgeNGramTokenFilterV2 setSide(EdgeNGramTokenFilterSide side)

Set the side property: Specifies which side of the input the n-gram should be generated from.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from TokenFilter

Methods inherited from java.lang.Object

Constructor Details

EdgeNGramTokenFilterV2

public EdgeNGramTokenFilterV2(String name)

Creates an instance of EdgeNGramTokenFilterV2 class.

Parameters:

name - the name value to set.

Method Details

fromJson

public static EdgeNGramTokenFilterV2 fromJson(JsonReader jsonReader)

Reads an instance of EdgeNGramTokenFilterV2 from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of EdgeNGramTokenFilterV2 if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getMaxGram

public Integer getMaxGram()

Get the maxGram property: The maximum n-gram length. Default is 2. Maximum is 300.

Returns:

the maxGram value.

getMinGram

public Integer getMinGram()

Get the minGram property: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the value of maxGram.

Returns:

the minGram value.

getOdataType

public String getOdataType()

Get the odataType property: The discriminator for derived types.

Overrides:

EdgeNGramTokenFilterV2.getOdataType()

Returns:

the odataType value.

getSide

public EdgeNGramTokenFilterSide getSide()

Get the side property: Specifies which side of the input the n-gram should be generated from. Default is "front".

Returns:

the side value.

setMaxGram

public EdgeNGramTokenFilterV2 setMaxGram(Integer maxGram)

Set the maxGram property: The maximum n-gram length. Default is 2. Maximum is 300.

Parameters:

maxGram - the maxGram value to set.

Returns:

the EdgeNGramTokenFilterV2 object itself.

setMinGram

public EdgeNGramTokenFilterV2 setMinGram(Integer minGram)

Set the minGram property: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the value of maxGram.

Parameters:

minGram - the minGram value to set.

Returns:

the EdgeNGramTokenFilterV2 object itself.

setSide

public EdgeNGramTokenFilterV2 setSide(EdgeNGramTokenFilterSide side)

Set the side property: Specifies which side of the input the n-gram should be generated from. Default is "front".

Parameters:

side - the side value to set.

Returns:

the EdgeNGramTokenFilterV2 object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

EdgeNGramTokenFilterV2.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to