on 2016 Apr 27 3:58 PM
How can I boost different terms in a search text differently in Solr? For example I search for "red pen", however the results are showing up products from brand "red tape". So to overcome this problem I decided to go for boosting. I'll set the boost of "pen" to be much higher than that of "red". How can I achieve that? I looked into the solr.impex file but it boosts fields and not search terms. Anyone got an idea?
Request clarification before answering.
Hi, Hybris gives to boost on the attribute and its value so you have to do some optimization in that mean you need to give "Red pen" in title. And than apply boost factor on that field by using below impex :
#####################################Bossting At category level#####################
$productCatalog=productCatalog
$catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Online'])[unique=true,default=$productCatalog:Online]
$solrIndexedTypeIdentifier=mitre10ProductType
$solrIndexedType=solrIndexedType(identifier[default=$solrIndexedTypeIdentifier])
INSERT_UPDATE CategorySolrSearchProfile;categoryCode[unique=true];code;indexedType(identifier)[unique=true];
;FN2354;supplier-profile;$solrIndexedTypeIdentifier;
INSERT_UPDATE SolrBoostRule;solrIndexedProperty(name, $solrIndexedType)[unique=true];operator(code)[unique=true];propertyValue[unique=true];boostFactor;solrSearchProfiles(code)[unique=true]
;title;CONTAINS;RED PEN;100;supplier-profile
#####################################Bossting At Global level#####################
$productCatalog=productCatalog
$catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Online'])[unique=true,default=$productCatalog:Online]
$solrIndexedTypeIdentifier=mitre10ProductType
$solrIndexedType=solrIndexedType(identifier[default=$solrIndexedTypeIdentifier])
INSERT_UPDATE GlobalSolrSearchProfile;code;indexedType(identifier)[unique=true];
;globalcatalog-srch-profile;$solrIndexedTypeIdentifier;
INSERT_UPDATE SolrBoostRule;solrIndexedProperty(name, $solrIndexedType)[unique=true];operator(code)[unique=true];propertyValue[unique=true];boostFactor;solrSearchProfiles(code)[unique=true]
;title;CONTAINS;RED PEN;100;globalcatalog-srch-profile
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
21 | |
16 | |
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.