11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In: "jump jumping jumped"<br />

Tokenizer to Filter: "jump", "jumping", "jumped"<br />

Out: "jump", "jump", "jump"<br />

Remove Duplicates Token Filter<br />

The filter removes duplicate tokens in the stream. Tokens are considered to be duplicates if they have the same<br />

text and position values.<br />

Factory class: solr.RemoveDuplicatesTokenFilterFactory<br />

Arguments: None<br />

Example:<br />

One example of where RemoveDuplicatesTokenFilterFactory is in situations where a synonym file is<br />

being used in conjuntion with a stemmer causes some synonyms to be reduced to the same stem. Consider the<br />

following entry from a synonyms.txt file:<br />

Television, Televisions, TV, TVs<br />

When used in the following configuration:<br />

<br />

<br />

<br />

<br />

<br />

<br />

In: "Watch TV"<br />

Tokenizer to Synonym Filter: "Watch"(1) "TV"(2)<br />

Synonym Filter to Stem Filter: "Watch"(1) "Television"(2) "Televisions"(2) "TV"(2) "TVs"(2)<br />

Stem Filter to Remove Dups Filter: "Watch"(1) "Television"(2) "Television"(2) "TV"(2) "TV"(2)<br />

Out: "Watch"(1) "Television"(2) "TV"(2)<br />

Reversed Wildcard Filter<br />

This filter reverses tokens to provide faster leading wildcard and prefix queries. Tokens without wildcards are not<br />

reversed.<br />

Factory class: solr.ReversedWildcardFilterFactory<br />

Arguments:<br />

withOriginal (boolean) If true, the filter produces both original and reversed tokens at the same positions. If<br />

false, produces only reversed tokens.<br />

maxPosAsterisk (integer, default = 2) The maximum position of the asterisk wildcard ('*') that triggers the<br />

reversal of the query term. Terms with asterisks at positions above this value are not reversed.<br />

maxPosQuestion (integer, default = 1) The maximum position of the question mark wildcard ('?') that triggers<br />

the reversal of query term. To reverse only pure suffix queries (queries with a single leading asterisk), set this to<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

133

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!