cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

solr synonym search is not working

Former Member
0 Kudos
1,943

Hi Experts,

I am using hybris 6.2.0.11 and Hybris OOB solr standalone instance.

I have created synonyms by below impex.

INSERT_UPDATE SolrSynonymConfig;facetSearchConfig(name)[unique=true];synonymFrom[unique=true];synonymTo;language(isocode) ;$facetSearchConfigName;"kingdom12345";"yyyy";en

Note: "yyyy" text is present in product name which is already available in solr server.

I have tried with Synonym Export button and also by doing full indexing from HMC.

But when searching text "kingdom12345" and it should give result for string "yyyy" . This query should give product but getting no product found.

When i checked in tomcat console. It give this below query.

DisMaxFreeTextQueryBuilder] {!multiMaxScore tie=0.0}((code_string:kingdom^90.0) OR (keywords_text_en:kingdom^20.0) OR (manufacturerName_text:kingdom^40.0) OR (categoryName_text_en_mv:kingdom^20.0) OR (ean_string:kingdom^100.0) OR (name_text_en:kingdom^50.0)) OR ((keywords_text_en:kingdom~^10.0) OR (manufacturerName_text:kingdom~^20.0) OR (categoryName_text_en_mv:kingdom~^10.0) OR (name_text_en:kingdom~^25.0)) OR ((code_string:kingdom*^45.0) OR (ean_string:kingdom*^50.0)) OR ((keywords_text_en:"kingdom"^40.0) OR (manufacturerName_text:"kingdom"^80.0) OR (categoryName_text_en_mv:"kingdom"^40.0) OR (name_text_en:"kingdom"^100.0))

Question1: From above log it seems synonym is not working and it is treating as plain text search. If this is not correct way to setup synonym then How can setup synonym for example "kingdom12345" to "yyyy" ?

Question2: How can i check ( UI Steps ) all synonyms present in solr server?

Thanks in advance.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hmm, if you add this listener properly in the backoffice you should see output like: apparelProductCatalog/Online/300791705= 210.27545 = sum of: 64.68245 = max of: 64.68245 = weight(categoryName_text_en_mv:shoe in 2175) [SchemaSimilarity], result of: 64.68245 = score(doc=2175,freq=2.0 = termFreq=2.0 ), product of: 20.0 = boost 2.557932 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from: 192.0 = docFreq 2484.0 = docCount 1.2643505 = tfNorm, computed as (freq (k1 + 1)) / (freq + k1 (1 - b + b * fieldLength / avgFieldLength)) from: 2.0 = termFreq=2.0 1.2 = parameter k1 0.75 = parameter b 6.1014495 = avgFieldLength 8.0 = fieldLength 16.228098 = max of: 16.228098 = sum of: 16.228098 = weight(categoryName_text_en_mv:shoe in 2175) [SchemaSimilarity], result of: 16.228098 = score(doc=2175,freq=2.0 = termFreq=2.0 ),

which will give you quite a good idea what and why has been matched. Could you verify that you added the listener properly?

Former Member
0 Kudos

ok do the same for the Field Value (Query) and paste it here. if you query from Sold admin console does it give you desired results? You could also enable solrQueryDebuggingListener - backoffice -> indexedTypes -> select indexedType -> Administration tab -> add Listener solrQueryDebuggingListener. Then rerun the search and check in the console what and why was matched.

Former Member
0 Kudos

Thanks for reply.

1- Please find attachment1(synonym1.png ) for Field Value query in solr admin console , still same result.

2 - I have added listener (bean id = "solrQueryDebuggingListener") in SolrIndexTypeModel as stated above. Please find log in attachment 2 (solrlog.txt link text).

For me , still any solution didn't work.

Former Member
0 Kudos

could you go to the solr admin console (by default http://localhost:8983), select core and go to the analysis. In the Field type select i.e text_en and in the Field Value (Query) input kingdom12345. Now hit Analyse Values and check if it shows you a synonyms also for this query.

Former Member
0 Kudos

I have checked value as specified in above steps.there value is coming in solr analyzer(check attachment) but value is not coming in storefront when searched text "kingdom12345" .

0 Kudos
How this issue is resolved , can you let me know, we are facing the same issue