error in suggester component in solr

前端 未结 1 801
一个人的身影
一个人的身影 2021-01-07 08:49

I am working with solr auto complete functionality,I am using solr 4.50 to build my application, and I am following this link as a reference. My suggest component is somethi

1条回答
  •  别那么骄傲
    2021-01-07 09:20

    I was able to get the autosuggest functionality working by using the Solr Term Component

    Add term components in your solrconfig.xml like this

    
      
      
         
          true
          false
             
        
          terms
        
      
    

    define a field type for your autosuggest text in schema.xml

          
            
              
              
            
        
    

    add fields in schema.xml like this

         
    
       
    
       
    

    Now the most important step... Remove all the folders from your index directory (can be found in solrconfig.xml ,.. look for tag)

    Restart the solr. and reindex your data. You will se new folders created in your index directory.

    You can check the auto suggest working by hitting the url -

    http://127.0.0.1:8983/solr/your_core/terms?terms.fl=autocomplete_text&omitHeader=true&terms.limit=20&terms.sort=index&terms.regex=(.*)your_query(.*)
    

    0 讨论(0)
提交回复
热议问题