LimitTokenFilter Class

public final class LimitTokenFilter
extends TokenFilter

Limits the number of tokens while indexing. This token filter is implemented using Apache Lucene.

Constructor Summary

Constructor Description
LimitTokenFilter(String name)

Creates an instance of LimitTokenFilter class.

Method Summary

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

Reads an instance of LimitTokenFilter from the JsonReader.

Integer getMaxTokenCount()

Get the maxTokenCount property: The maximum number of tokens to produce.

String getOdataType()

Get the odataType property: The discriminator for derived types.

Boolean isConsumeAllTokens()

Get the consumeAllTokens property: A value indicating whether all tokens from the input must be consumed even if maxTokenCount is reached.

LimitTokenFilter setConsumeAllTokens(Boolean consumeAllTokens)

Set the consumeAllTokens property: A value indicating whether all tokens from the input must be consumed even if maxTokenCount is reached.

LimitTokenFilter setMaxTokenCount(Integer maxTokenCount)

Set the maxTokenCount property: The maximum number of tokens to produce.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from TokenFilter

Methods inherited from java.lang.Object

Constructor Details

LimitTokenFilter

public LimitTokenFilter(String name)

Creates an instance of LimitTokenFilter class.

Parameters:

name - the name value to set.

Method Details

fromJson

public static LimitTokenFilter fromJson(JsonReader jsonReader)

Reads an instance of LimitTokenFilter from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of LimitTokenFilter 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.

getMaxTokenCount

public Integer getMaxTokenCount()

Get the maxTokenCount property: The maximum number of tokens to produce. Default is 1.

Returns:

the maxTokenCount value.

getOdataType

public String getOdataType()

Get the odataType property: The discriminator for derived types.

Overrides:

LimitTokenFilter.getOdataType()

Returns:

the odataType value.

isConsumeAllTokens

public Boolean isConsumeAllTokens()

Get the consumeAllTokens property: A value indicating whether all tokens from the input must be consumed even if maxTokenCount is reached. Default is false.

Returns:

the consumeAllTokens value.

setConsumeAllTokens

public LimitTokenFilter setConsumeAllTokens(Boolean consumeAllTokens)

Set the consumeAllTokens property: A value indicating whether all tokens from the input must be consumed even if maxTokenCount is reached. Default is false.

Parameters:

consumeAllTokens - the consumeAllTokens value to set.

Returns:

the LimitTokenFilter object itself.

setMaxTokenCount

public LimitTokenFilter setMaxTokenCount(Integer maxTokenCount)

Set the maxTokenCount property: The maximum number of tokens to produce. Default is 1.

Parameters:

maxTokenCount - the maxTokenCount value to set.

Returns:

the LimitTokenFilter object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

LimitTokenFilter.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to