How to make solr synonyms work

前端 未结 3 493
一生所求
一生所求 2021-02-07 21:36

I\'m trying to set up some basic synonyms in Solr. The one I\'ve been working on is:

us, usa, united states

My understanding is that adding that to the synonym f

3条回答
  •  旧巷少年郎
    2021-02-07 22:08

    For better understanding of synonym search, Please follow step by step process of implementation below (I am using solr 6.5.* version):

    Step 1:

    Download country-synonyms.txt text file and place it in below path:

    Path: \solr-6.5.1\server\solr\yourCore\conf

    yourCore: Name of core should be changed accordingly

    Step 2:

    Add Field type in managed-schema file in same path mentioned above:

    
    
      
      
      
      
    
    

    Step 3: Add your field(Nationality) with type country in same file(managed-schema).

    
    

    Step 4: Restart solr.

    solr restart -p 
    

    Step 5:

    Now import your data with field containing Nationality.***

    Step 6:

    Now query with below cases and test:

    Query:

    1. Nationality:US
    2. Nationality:USA
    3. Nationality:United States
    4. Nationality:United States of America

    All above queries will give you same result.

    Note:*** Import data only after performing above steps including solr restart. It may not work on existing data(For more details refer: AnalyzersTokenizersTokenFilters)

提交回复
热议问题