Update Solr.md

Added documentation for how to search on macrons and other unicode characters. Thanks to @chrispenny for the code sample.
This commit is contained in:
Elliot Sawyer 2017-03-28 16:12:56 +13:00 committed by GitHub
parent 91ef18a734
commit 5790802544

View File

@ -192,6 +192,20 @@ from a new file `mysite/solr/templates/types.ss` instead:
} }
} }
#### Searching for macrons and other Unicode characters
The “ASCIIFoldingFilterFactory” filter converts alphabetic, numeric, and symbolic Unicode characters which are not in the Basic Latin Unicode block (the first 127 ASCII characters) to their ASCII equivalents, if one exists.
Find the fields in your overloaded `types.ss` that you want to enable this behaviour in. EG:
<fieldType name="htmltext" class="solr.TextField" ... >
Add the following to both its index analyzer and query analyzer records.
<filter class="solr.ASCIIFoldingFilterFactory"/>
Update your index to point to your overloaded template using the method described above.
### Spell Checking ("Did you mean...") ### Spell Checking ("Did you mean...")
Solr has various spell checking strategies (see the ["SpellCheckComponent" docs](http://wiki.apache.org/solr/SpellCheckComponent)), all of which are configured through `solrconfig.xml`. Solr has various spell checking strategies (see the ["SpellCheckComponent" docs](http://wiki.apache.org/solr/SpellCheckComponent)), all of which are configured through `solrconfig.xml`.