Solr - synonyms containing multiple words

后端 未结 4 863
佛祖请我去吃肉
佛祖请我去吃肉 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:44

    The problem is that solr synonyms tend to cause issues when the number of words in the first phrase is less than the number of words in the second phrase. When this happens, tokens overflow into the positions of other tokens.

    I have a workaround for this problem, but it requires two uses of solr.SynonymFilterFactory at index and query time.

    Like this :

    
    
    
    

    In the first filter you will have: New York => New_York

    In the second filter: NYC => New_York

    Now a search for New York will return results containing NYC and vice verses.

    On a final note: This will method will not work unless it is at index and query time.

提交回复
热议问题