cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the boost of terms.

Former Member
0 Kudos
721

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?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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
Former Member
0 Kudos

This impex throws an error while importing in hac, saying that contains is not defined.

Former Member
0 Kudos

OK, open backoffice and open solrfacetsearch and here you can apply boost rule. Also you can configure from HMC opening your index and open index property than configre boost rule from boost tab.

Answers (0)