SynonymFilterFactory can take tokenizerFactory attribute that is used when
reading synonyms file. If you don't specify it, WhitespaceTokenizerFactory will
be used.
https://builds.apache.org/job/Solr-trunk/javadoc/org/apache/solr/analysis/SynonymFilterFactory.html
koji
--
Check out "Query Log Visualizer" for Apache Solr
http://www.rondhuit-demo.com/loganalyzer/loganalyzer.html
http://www.rondhuit.com/en/
(11/12/17 23:31), Bojan Miletic wrote:
Hi everyone,
I'm having a bit of problem with synonyms.
My synonyms.txt looks like this:
class\ 3\ (gvw\ 10001\ -\ 14000), light
class 4 (gvw 14001 - 16000), class 5 (gvw 16001 - 19500), class 6 (gvw
19501 - 26000), medium
When testing in analyzer by using solr admin light gets correctly
recognised as one of the synonims, but when searching for class 3 (gvw
10001 - 14000) analyzer can't find any synonyms.
As you can see I tried escaping whitespaces with \ but that didn't help.
Configuration of used field is
!-- lowercases the entire field value, keeping it as a single token. -->
<!-- used for working with synonyms -->
<fieldType name="lowercase_syn" class="solr.TextField"
positionIncrementGap="100">
<analyzer type="index">>
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
</analyzer>
<analyzer type="query">>
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
</fieldType>
Could you please help me?
Thanks