UniqueTokenFilter Class

public final class UniqueTokenFilter
extends TokenFilter

Filters out tokens with same text as the previous token. This token filter is implemented using Apache Lucene.

Constructor Summary

Constructor Description
UniqueTokenFilter(String name)

Creates an instance of UniqueTokenFilter class.

Method Summary

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

Reads an instance of UniqueTokenFilter from the JsonReader.

String getOdataType()

Get the odataType property: A URI fragment specifying the type of token filter.

Boolean isOnlyOnSamePosition()

Get the onlyOnSamePosition property: A value indicating whether to remove duplicates only at the same position.

UniqueTokenFilter setOnlyOnSamePosition(Boolean onlyOnSamePosition)

Set the onlyOnSamePosition property: A value indicating whether to remove duplicates only at the same position.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from TokenFilter

Methods inherited from java.lang.Object

Constructor Details

UniqueTokenFilter

public UniqueTokenFilter(String name)

Creates an instance of UniqueTokenFilter class.

Parameters:

name - the name value to set.

Method Details

fromJson

public static UniqueTokenFilter fromJson(JsonReader jsonReader)

Reads an instance of UniqueTokenFilter from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

getOdataType

public String getOdataType()

Get the odataType property: A URI fragment specifying the type of token filter.

Overrides:

UniqueTokenFilter.getOdataType()

Returns:

the odataType value.

isOnlyOnSamePosition

public Boolean isOnlyOnSamePosition()

Get the onlyOnSamePosition property: A value indicating whether to remove duplicates only at the same position. Default is false.

Returns:

the onlyOnSamePosition value.

setOnlyOnSamePosition

public UniqueTokenFilter setOnlyOnSamePosition(Boolean onlyOnSamePosition)

Set the onlyOnSamePosition property: A value indicating whether to remove duplicates only at the same position. Default is false.

Parameters:

onlyOnSamePosition - the onlyOnSamePosition value to set.

Returns:

the UniqueTokenFilter object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

UniqueTokenFilter.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to