From f5392b630f10a3f4813872787b8c618242265eac Mon Sep 17 00:00:00 2001 From: Elliot Sawyer Date: Tue, 28 Mar 2017 16:20:46 +1300 Subject: [PATCH] Update Solr.md Update documentation explaining how to search for numeric terms by overloading types.ss --- docs/en/Solr.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/en/Solr.md b/docs/en/Solr.md index 89e22bb..c84a0d3 100644 --- a/docs/en/Solr.md +++ b/docs/en/Solr.md @@ -191,6 +191,17 @@ from a new file `mysite/solr/templates/types.ss` instead: return $this->renderWith(Director::baseFolder() . '/mysite/solr/templates/types.ss'); } } + +#### Searching for words containing numbers + +By default, the fulltextmodule is configured to split words containing numbers into multiple tokens. For example, the word “A1” would be interpreted as “A” “1”; since “a” is a common stopword, the term “A1” will be excluded from search. + +To allow searches on words containing numeric tokens, you'll need to update your overloaded template to change the behaviour of the WordDelimiterFilterFactory. Each instance of `` needs to include the following attributes and values: + +* add splitOnNumerics="0" on all WordDelimiterFilterFactory fields +* change catenateOnNumbers="1" on all WordDelimiterFilterFactory fields + +Update your index to point to your overloaded template using the method described above. ### Spell Checking ("Did you mean...")