Hi,

We are in process of migrating our solr environment from standalone Solr(4.9) 
to SolrCloud(6.2.1).
During this process we facing issues with solr.SuggestComponent, which is 
working fine earlier in 4.9 with solr.TermsComponent

PFB detailed description for same and kindly assistance.
Let us know if any additional details are required

Collection Name: Al_prnt_grp
Shards                  : IN_39_SWG and IN_40_SWG(dynamically created using 
implicit router)
Document indexed into IN_39_SWG shared(which has words like company, computer, 
compare with etc.)


*         Using below entries/configuration in solrconfig.xml and 
managed-schema.xml I have uploaded the configsets to zookeeper.

*         And reloaded the collection using collection api.


*         Finally when I was running below query for auto-complete, it was not 
displaying 0 suggestions found.
http://<IP Address>:<Port 
No.>/solr/Al_prnt_grp/suggesthandler?suggest.dictionary=mySuggester&suggest=true&suggest.reload&suggest.build=true&suggest.q=comp&shards.keys=<IP
 Address>:<Port 
No.>/solr/IN_39_SWG&indent=true&shards.qt=/suggest&distrib=false&omitHeader=true&wt=json<http://10.122.97.20:5906/solr/Al_prnt_grp/suggesthandler?suggest.dictionary=mySuggester&suggest=true&suggest.reload&suggest.build=true&suggest.q=comp&shards.keys=10.122.97.20:5906/solr/GN_39_SWG&indent=true&shards.qt=/suggest&distrib=false&omitHeader=true&wt=json>


*         When I have gone through solr.log I was seeing below error.
INFO  - 2016-12-05 05:45:05.982; [c:Al_prnt_grp s:IN_40_SWG r:core_node5 
x:Al_prnt_grp_IN_40_SWG_replica3] 
org.apache.solr.spelling.suggest.SolrSuggester; SolrSuggester.build(mySuggester)
ERROR - 2016-12-05 05:45:05.984; [c:Al_prnt_grp s:IN_40_SWG r:core_node5 
x:Al_prnt_grp_IN_40_SWG_replica3] 
org.apache.solr.spelling.suggest.SolrSuggester; Store Lookup build failed
INFO  - 2016-12-05 05:45:05.984; [c:Al_prnt_grp s:IN_40_SWG r:core_node5 
x:Al_prnt_grp_IN_40_SWG_replica3] 
org.apache.solr.handler.component.SuggestComponent; SuggestComponent process 
with : shards.keys=<IP Address>:<Port 
No.>/solr/IN_39_SWG&distrib=false&suggest.build=true&indent=true&omitHeader=true&suggest.q=comp&suggest.count=10&suggest.reload=&suggest=true&suggest.dictionary=mySuggester&wt=json&shards.qt=/suggest


*         When I am looking into forums I see similar issue was raised on 
20/Jun/2016 which is still open.
https://issues.apache.org/jira/browse/SOLR-9227

Step 1: Entry in solrconfig.xml

*         Added searchcomponent and requesthandler for same in solrconfig.xml


<searchComponent name="suggest" class="solr.SuggestComponent">
  <lst name="suggester">
    <str name="name">mySuggester</str>
    <str name="lookupImpl">FuzzyLookupFactory</str>
    <str name="storeDir">suggester_fuzzy_dir</str>
    <str name="dictionaryImpl">DocumentDictionaryFactory</str>
    <str name="field">content_autosuggest</str>
    <str name="suggestAnalyzerFieldType">text_auto</str>
    <str name="buildOnStartup">false</str>
    <str name="buildOnCommit">false</str>
  </lst>
</searchComponent>

<requestHandler name="/suggesthandler" class="solr.SearchHandler" 
startup="lazy" >
  <lst name="defaults">
    <str name="suggest">true</str>
    <str name="suggest.count">10</str>
    <str name="suggest.dictionary">mySuggester</str>
    <bool name="distrib">false</bool>
  </lst>
  <arr name="components">
    <str>suggest</str>
  </arr>

</requestHandler>

Step 2 : Entry in managed-schema.xml

                <field name="content_autosuggest" type="text_auto" 
indexed="true" stored="true" multiValued="true" />
       .......
       <fieldType name="text_auto" class="solr.TextField" 
positionIncrementGap="100">
             <analyzer type="index">
               <tokenizer class="solr.KeywordTokenizerFactory"/>
              </analyzer>
             <analyzer type="query">
              <searchComponent name="terms" class="solr.TermsComponent"/>
              <tokenizer class="solr.KeywordTokenizerFactory"/>
              <filter class="solr.LowerCaseFilterFactory"/>
              <filter class="solr.StopFilterFactory" ignoreCase="true" 
words="lang/stopwords_en.txt"/>
<filter class="solr.ShingleFilterFactory" minShingleSize="2" maxShingleSize="2" 
outputUnigrams="true" outputUnigramsIfNoShingles="false" tokenSeparator=" "
fillerToken="_"/>
</analyzer>
      </fieldType>

Step 3 : Uploaded configsets to zookeeper for one collection

./zkcli.sh zkcli.sh -cmd upconfig -zkhost  zookeeperdev:8080,zookeeperprod:8081 
 -collection Al_prnt_grp -confname IR_CORE -solrhome 
/opt/solrusrcloud/solr-6.2.1/server/solr -confdir 
/opt/solrcloud/solr-6.2.1/server/solr/configsets/data_driven_schema_configs/conf

Step 4 : Reloaded the collection

http://<IP Address>:<Port 
No.>/solr/admin/collections?action=RELOAD&name=Al_prnt_grp<http://%3cIP%20Address%3e:%3cPort%20No.%3e/solr/admin/collections?action=RELOAD&name=Al_prnt_grp>



Best Regards,
V.V.R.Pavan Kumar
Technology Lead
INDD Unit
Infosys Limited
Desk : +91 044 44462476
Mob   : +91 7823982845

Reply via email to