Solr - synonyms containing multiple words

后端 未结 4 862
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-30 07:52

Quick question, I don\'t know how to deal with synonyms which contains a space! I have the following config:

The SOLR config file



        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-30 08:30

    About

    st., st => saint
    

    I think you should do it that way :

    st. => saint
    st => saint
    

    About

    NY => New York
    

    I'm facing a similar issue and came to the conclusion that it's because parsing is done BEFORE synonym replacement, which is likely causing a problem when multi word. I found that it is possible to include a parser into SynonymFactory :

     
    

    I just tested it I got much better results, but not yet the one expected. Strangely enough, when adding KeywordTokenizerFactory seems to impact positvely, adding WhitespaceTokenizerFactory or StandardTokenizerFactory doesn't seem to change anything.

    BTW, if not using shingles, this should already be fine.

提交回复
热议问题