Mailing List Archive

Query regarding integrating solr query functions into blockfacetjoin Query
Ravi Kumar <ravikt1705@gmail.com>
8:23 PM (1 minute ago)
to solr-user
Hi Team,

I was implementing block join faceting query in my project and was stuck in
integrating the existing functional queries in the block join faceting
query.

*The current query using 'select' handler is as follows* :-
https://localhost:8983/solr/master_Product_default/*select*?*yq*
=_query_:%22\{\!multiMaxScore\+tie%3D0.0\}\(\(bomCode_bc_string\:samsung\)\+OR\+\(description_text_en\:samsung\)\+OR\+\(belleaprice_cad_bc846_string\:samsung\^20.0\)\+OR\+\(name_text_en\:samsung\^50.0\)\+OR\+\(category_string_mv\:samsung\^20.0\)\)\+OR\+\(\(belleaprice_cad_bc846_string\:samsung\~\^10.0\)\)\+OR\+\(\(bomCode_bc_string\:\%22samsung\%22\^50.0\)\+OR\+\(code_string\:\%22samsung\%22\~1.0\^90.0\)\+OR\+\(vendorId_string\:\%22samsung\%22\^95.0\)\+OR\+\(description_text_en\:\%22samsung\%22\^50.0\)\+OR\+\(belleaprice_cad_bc846_string\:\%22samsung\%22\^40.0\)\+OR\+\(name_text_en\:\%22samsung\%22\^100.0\)\+OR\+\(category_string_mv\:\%22samsung\%22\^40.0\)\+OR\+\(upcCode_bc846_string\:\%22samsung\%22\^99.0\)\)%22&
*yab*
=sum(product(and(not(exists(omniOnlineStockStatus_boolean)),exists(inStoreStockStatus_bc846_bellea_boolean)),70.0),product(and(exists(omniOnlineStockStatus_boolean),exists(inStoreStockStatus_bc846_bellea_boolean)),80.0),product(and(exists(omniOnlineStockStatus_boolean),not(exists(inStoreStockStatus_bc846_bellea_boolean))),40.0),product(exists(omniInStoreStockStatus_bc_boolean),20.0))&*q={!boost}(+{!lucene
v=$yq} {!func v=$yab})*
&fq=(omniAssortment_bc846_boolean:true+OR+omniAssortment_a002_boolean:true)&fq=(srpPriceValue_bc846_string:[0.0+TO+*])&fq=(omniVisible_20_bellea_bc_boolean:true)&fq=(catalogId:%22belleaProductCatalog%22+AND+catalogVersion:%22Online%22)&sort=score+desc,omniInStoreStockStatus_bc_boolean+asc,creationtime_sortable_date+desc,inStoreStockStatus_bc846_bellea_boolean+asc,omniOnlineStockStatus_boolean+asc&start=0&rows=20000&facet.field=characteristics_string&facet.field=inStoreStockStatus_bc846_bellea_boolean&facet.field=memorySize_string_mv&facet.field=color_en_string&facet.field=belleaprice_cad_bc846_string&facet.field=supplier_string&facet.field=model_string_mv&facet.field=omniOnlineStockStatus_boolean&facet.field=category_string_mv&facet.field=omniInStoreStockStatus_bc_boolean&facet.field=stockAvailability_string&facet=true&facet.sort=count&facet.mincount=1&facet.limit=110000&fl=score,*&fl=[child+parentFilter%3D%22itemtype_string:Product%22+childFilter%3D%22brands_stringignorecase_mv:BC+AND+regions_stringignorecase_mv:ON+AND+activationTypes_stringignorecase_mv:N+AND+channels_stringignorecase_mv:NR+AND+banners_stringignorecase_mv:\%22Walmart\%22+AND+(accountTypes_stringignorecase_mv:IR+OR+accountTypes_stringignorecase_mv:empty)%22+limit%3D1000]&spellcheck=true&spellcheck.q=samsung&spellcheck.dictionary=en&spellcheck.collate=true

In the above query, the *'yq'* and* 'yab'* functions are integrated in the
main query using expression below :-
*q={!boost}(+{!lucene v=$yq} {!func v=$yab}) *

I want to integrate the *'yq' and 'yab'* function queries in the *future
block join faceting query* mentioned below :-

https://localhost:8983/solr/master_Product_default/*blockJoinFacetRH*?
*q={!parent%20which=%22itemtype_string:Product%22}itemtype_string:TierPrice&wt=json&indent=true&facet=true&child.facet.field=contract_string&rows=500*
&fq=(omniAssortment_bc846_boolean:true+OR+omniAssortment_a002_boolean:true)&fq=(srpPriceValue_bc846_string:[0.0+TO+*])&fq=(omniVisible_20_bellea_bc_boolean:true)&fq=(catalogId:%22belleaProductCatalog%22+AND+catalogVersion:%22Online%22)&sort=score+desc,omniInStoreStockStatus_bc_boolean+asc,creationtime_sortable_date+desc,inStoreStockStatus_bc846_bellea_boolean+asc,omniOnlineStockStatus_boolean+asc&start=0&rows=2000&facet.field=characteristics_string&facet.field=inStoreStockStatus_bc846_bellea_boolean&facet.field=memorySize_string_mv&facet.field=color_en_string&facet.field=belleaprice_cad_bc846_string&facet.field=supplier_string&facet.field=model_string_mv&facet.field=omniOnlineStockStatus_boolean&facet.field=category_string_mv&facet.field=omniInStoreStockStatus_bc_boolean&facet.field=stockAvailability_string&facet=true&facet.sort=count&facet.mincount=1&facet.limit=110000&fl=score,*&fl=[child+parentFilter%3D%22itemtype_string:Product%22+childFilter%3D%22brands_stringignorecase_mv:BC+AND+regions_stringignorecase_mv:ON+AND+activationTypes_stringignorecase_mv:N+AND+channels_stringignorecase_mv:NR+AND+banners_stringignorecase_mv:\%22Walmart\%22+AND+(accountTypes_stringignorecase_mv:IR+OR+accountTypes_stringignorecase_mv:empty)%22+limit%3D1000]&spellcheck=true&spellcheck.q=samsung&spellcheck.dictionary=en&spellcheck.collate=true

Can someone please suggest how can I add the expression '* {!boost}(+{!lucene
v=$yq} {!func v=$yab})*' functions in the block join facting query
-"*q={!parent%20which=%22itemtype_string:Product%22}
itemtype_string:TierPrice&wt=json&indent=true&facet=true&child.facet.field=contract_string&rows=500*"
?

I shall be highly grateful if someone can suggest to me some insight.

Thanks & Regards,

Ravi Kumar
SAP Hybris Consultant