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.

<br />

<br />

<br />

In: "cat concatenate catycat"<br />

Tokenizer to Filter: "cat", "concatenate", "catycat"<br />

Out: "dog", "condogenate", "dogycat"<br />

Example:<br />

More complex pattern with capture group reference in the replacement. Tokens that start with non-numeric<br />

characters and end with digits will have an underscore inserted before the numbers. Otherwise the token is<br />

passed through.<br />

<br />

<br />

<br />

<br />

In: "cat foo1234 9987 blah1234foo"<br />

Tokenizer to Filter: "cat", "foo1234", "9987", "blah1234foo"<br />

Out: "cat", "foo_1234", "9987", "blah1234foo"<br />

Phonetic Filter<br />

This filter creates tokens using one of the phonetic encoding algorithms in the org.apache.commons.codec.<br />

language package. For more information, see the section on Phonetic Matching.<br />

Factory class: solr.PhoneticFilterFactory<br />

Arguments:<br />

encoder: (required) The name of the encoder to use. The encoder name must be one of the following (case<br />

insensitive): " DoubleMetaphone", " Metaphone", " Soundex", " RefinedSoundex", " Caverphone" (v2.0), " CologneP<br />

honetic", or " Nysiis".<br />

inject: (true/false) If true (the default), then new phonetic tokens are added to the stream. Otherwise, tokens<br />

are replaced with the phonetic equivalent. Setting this to false will enable phonetic matching, but the exact<br />

spelling of the target word may not match.<br />

maxCodeLength: (integer) The maximum length of the code to be generated by the Metaphone or Double<br />

Metaphone encoders.<br />

Example:<br />

Default behavior for DoubleMetaphone encoding.<br />

<br />

<br />

<br />

<br />

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

131

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

Saved successfully!

Ooh no, something went wrong!