on 09-11-2020 9:12 AM
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.
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:
Thanks!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
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.