How to write a 'fq' by joining two different indexes.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to write a 'fq' by joining two different indexes.

Siva ReddySM
 Hi,

We have a requirement to get a list of products based on product attribute
and inventory.

Problem, use case and test data is given below.

InentoryIndex is a sub index to ProductIndex. Both ProductIndex and
InventoryIndex share common node called "catentry_id".

Example of ProductIndex is shown below. It has other details. I have given
only required fields.

"catentry_id":"34438",
"ad_attribute":[
          "7000000000000006001/_/SAP Status/_/SAP
Status/_/570.00000/_/7000000000000437191/_/SAP
Status_1379715/_/AC/_/.00000/_/0/_/1/_/0/_/0/_/1/_/2/_/0/_/Status
information/_/0/_/0/_/0"
          ],

Example of InventoryIndex is shown below.
"inv_strlocqty_12501_715840384":99999.0,
        "catentry_id":"15073",
        "indexedTime":"2020-05-21T14:26:12.625Z"

Testing Data :
----------------
15015 : AC : Qty : 0
15009 : UI : Qty : 0
15073 : UI : Qty : 99999
15079 : AC : Qty : 99999
15001 : MA : Qty : 0
15003 : MA : Qty : 99999

Use case
--------
IF Product Inventory is greater than 0, then no need to check for SAP
Status. Display the product irrespective of 'SAP Status' value.
IF Product Inventory is 0, then need to check for attribute 'SAP Status'.
If there is an attribute associated to that product has value either AC.

Now, If I want to write the above use case in the form of fq, what should
be the syntax? I have tried different forms of fq, but I was not able to
get the correct result. Example url :

https://localhost:3738/solr/MC_12001_CatalogEntry_nl_NL/select?debugQuery=true&fl=catentry_id&start=0&rows=50&timeAllowed=15000&facet=true&defType=edismax&qf=catentry_id&tie=0.1&wt=json&json.nl=map&q="15015"
"15009" "15073" "15079" "15001"
"15003"&fq=catalog_id:12051&fq=storeent_id:("12601" "12501")&fq=(!{!join
from=catentry_id to=catentry_id
fromIndex=MC_12001_CatalogEntry_Inventory_generic}inv_strlocqty_12501_715840384:0)
(ads_f11501_ntk_cs:"AC" AND {!join from=catentry_id to=catentry_id
fromIndex=MC_12001_CatalogEntry_Inventory_generic}inv_strlocqty_12501_715840384:0)

Can you please let me know the correct syntax?

Thanks,
Siva.

--
De informatie verzonden middels dit emailbericht is uitsluitend bestemd
voor de geadresseerde. Gebruik van deze informatie door anderen dan de
geadresseerde, evenals openbaarmaking, vermenigvuldiging, verspreiding
en/of verstrekking aan derden is zonder uitdrukkelijke toestemming van
Cursum B.V. niet toegestaan. Tevens is Cursum B.V. niet aansprakelijk voor
onjuiste en/of onvolledige overbrenging van de inhoud van verzonden e-mail,
noch voor het tijdstip van ontvangst.