cancel
Showing results for 
Search instead for 
Did you mean: 

SOLR Issues With DISMAX

former_member649307
Discoverer
0 Kudos

Hello,

I'm trying to query certain fields using "DISMAX Query Parser" , so the query is like below,

bq=country:AU^100.0&defType=dismax&df=dismax&q.alt=((name_text:xxx^500.0)OR(firstName_text:xxx^500.0)) which is working fine in Solr Admin console but when trying to write logic via code and execute it the result is empty.

The query framed in code level,

yq=:()&q={!boost}(%2B{!lucene+v%3D$yq})&fq=(yyy_text:(*:*+AND+!INACTIVE))&sort=score+desc☆t=0&rows=10&facet.sort=count&facet.mincount=1&facet.limit=50&fl=score,*&bq=country:AU^100.0&defType=dismax&df=dismax&q.alt=((name_text:xxx^500.0)OR(firstName_text:xxx^500.0))

Need help on this query framing to understand more.

0 Kudos

Hi nandhini_marimuthu ,

Difference in search query used on console & generated by Hybris code.

parameter q is not present in query executed on solr console, however it is present in the query generated. q.alt only takes in consideration when parameter "q" is missing. Remove parameter "q" from query generated by code, it will give same results.

former_member649307
Discoverer
0 Kudos

Hello rajendra_gaikwad ,

No its not working even with q param,

https://localhost:8983/solr/XXXXXX/select?bq=Country_string%3APL%5E100.0&defType=dismax&df=dismax&q=...

Im searching '25392907' in 'yyy_text' query field using dismax search. Getting result in solr admin.

Hybris Query Framed is,

yq=(25392907)&q={!boost}(%2B{!lucene+v%3D$yq})&sort=score+desc☆t=0&rows=10&facet.sort=count&facet.mincount=1&facet.limit=50&fl=score,*&bq=Country_string:PL^100.0&defType=dismax&df=dismax&qf=yy_text

I'm trying to frame same query but result is empty.

How the 'yq' is queried in hybris? will the complete 'yq' data will be queried in 'q' param in solr admin console ? or based on filed name will be set and queired?

Accepted Solutions (0)

Answers (1)

Answers (1)

Hi nandhini_marimuthu

Still both queries are not same.

Query 1:

yq=(25392907)&q={!boost}(%2B{!lucene+v%3D$yq})&sort=score+desc☆t=0&rows=10&facet.sort=count&facet.mincount=1&facet.limit=50&fl=score,*&bq=Country_string:PL^100.0&defType=dismax&df=dismax&qf=yy_text

and

Query 2:

bq=Country_string%3APL%5E100.0&defType=dismax&df=dismax&q=25392907&qf=yyy_text

Query 1 & Query 2 are different. As per your comment Query 2 is working fine. Query 1 has problem.

Below is explanation for problem with Query 1:

q parameter is {!boost}(%2B{!lucene+v%3D$yq}), this means it uses boost, lucene & dismax these three parser. they generates the query which doesn't matched.

Query 1 is generated by hybris. if your customizing out-of-box generated query to append qf parameter, then will suggest also override q parameter, and make it simple q=25392907.

Hybris provided powerful out-of-box query building framework, it uses query template. kindly try that before customizing Hybris generated query.

Sharing query template link for details:

https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/2005/en-US/e325ba3ca67445c78ce94a1b9d34...

Thanks!!!