(11/02/17 0:17), alexw wrote:
Hi everyone, I am trying to get Synonyms working with CJKAnalyzer. Search works fine but synonyms do not work as expected. Here is my field definition in the schema file: <fieldType name="cjk" class="solr.TextField"> <analyzer class="org.apache.lucene.analysis.cjk.CJKAnalyzer"> <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> </analyzer> </fieldType> When testing on the analysis page, the synonym filter does not kick in at all. My question is: What am I doing wrong and what is the proper way of defining the field type?
Alex, Use <tokenizer/> with attribute class="solr.CJKTokenizerFactory" instead of <analyzer class="XXXAnalyzer"/>. Plus, you need to set tokenizerFactory="solr.CJKTokenizerFactory" in <filter/> for SynonymFilterFactory. Koji -- http://www.rondhuit.com/en/