Solr - synonyms containing multiple words

后端 未结 4 850
佛祖请我去吃肉
佛祖请我去吃肉 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条回答
  •  萌比男神i
    2020-12-30 08:22

    You are doing explicit mapping with =>.

    The Solr documentation says

    Explicit mappings match any token sequence on the LHS of "=>" and replace with all alternatives on the RHS. These types of mappings ignore the expand parameter in the schema.

    So I am guessing that if you search for NYC you get nothing back, since it got replaced with New York at index time.

    Instead, can you try declaring them as equivalent synonyms? i.e. like NYC, New York instead of NYC => New York.

    Then I believe you can search for either of them and the result will be the same.

提交回复
热议问题