There are two types of auto suggestions..
1)
Suggest keywords based on Search term.
2)
Suggest actual Entity based on Search term.
/conf/solrconfig.xml
- Configure request handler for /terms URL
- Configure wc_textSuggest and wc_spellCheck configuration
/conf/schema.xml
- Define SOLR fields that are too be shown as Auto Suggested keywords when searched for Terms
- Define Spell check fields which are to be spell corrected for showing suggestions
SOLR Configuration Changes
<!--
WebSphere Commerce terms request handler
This requestHandler can be used for search term auto-suggest.
-->
<requestHandler name="/terms" class="org.apache.solr.handler.component.SearchHandler">
<lst name="defaults">
<bool name="terms">true</bool>
<str name="terms.fl">spellCheck</str>
<str name="terms.limit">5</str>
<str name="terms.mincount">1</str>
<str name="terms.sort">count</str>
<bool name="omitHeader">true</bool>
<bool name="indent">false</bool>
<str name="wt">json</str>
</lst>
<arr name="components">
<str>wc_termsComponent</str>
</arr>
</requestHandler>
SOLR
Schema Changes
SOLR Field Type Configurations
We
need to ensure that required field types are configured in respective schema.xml- wc_textSuggest
- spellCorrection
- spellCheck
Setup
Verification
Once we have done the configuration, we can see if the designated fields are split properly by hitting /term url as below
http://localhost/solr/MC_10001_Shop_en_US/terms?terms.fl=city&terms.sort=index&terms.limit=15&terms.prefix=chem
terms.fl Designated Auto Suggestion type field
terms.limit Number of terms to return
terms.prefix Initials of search term.
http://localhost/solr/MC_10001_Shop_en_US/terms?qt=%2Fterms&terms.prefix=checm&terms.fl=spellCheck
And the response is :
{
"terms":{
"spellCheck":[
"chemist",5,
"chemist shop",2,
"chemist shop new delhi",1,
"india chemicals",1]}
}
I have got more information about websphere commerce.
ReplyDeleteWebsphere Training in Chennai
Websphere Message Broker Admin Training Chennai
IBM Data Power Training in Chennai
Websphere MQ Training in Chennai
how to avoid comma(,) coming in auto suggest - is there any configurations ?
ReplyDeleteIts really an Excellent post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog. Thanks for sharing....
ReplyDeleteJava training in Bangalore | Java training in Marathahalli
Java training in Bangalore | Java training in Btm layout
Java training in Bangalore |Java training in Rajaji nagar
)Deep Learning Projects assist final year students with improving your applied Deep Learning skills rapidly while allowing you to investigate an intriguing point. Furthermore, you can include Deep Learning projects for final year into your portfolio, making it simpler to get a vocation, discover cool profession openings,
ReplyDeleteWebsphere Message Broker Training in Bangalore