1

An example data structure of my record(s) are:

{
    foo: "bar",
    foo1: [
        { b1: "x", b2: "y" }
    ]
}

I am using React InstantSearch widgets where I have many refinement lists, two of which are on foo1.b1 and foo.b2 attributes.

Expectation - user selects value "x" for foo1.b1 attribute and "y" for foo1.b2 attribute. Records that have both values set should be returned. (AND condition).

Actual: Records where either foo1.b1 is "x" OR foo1.b2 is "y" are being returned.

Since I am using React InstantSearch widget and RefinementList, I am not sure how I can achieve the above. I looked at connectRefinmentList and virtual refinement lists but they seem to only work with a single attribute at a time.

Here's a Demo link of the issue.

Select Language as English and Language Level as Conversational.

Expected: Only Item # 3 and Item # 4 to show up.

Actual: All 4 items are seen.

callmekatootie
  • 10,989
  • 15
  • 69
  • 104
  • it is because 2 of the items have 2 elements in the array with 1 having x Conversational and the other y English. those 2 are getting matched – cmgchess Jan 23 '23 at 18:40
  • a solution is to duplicate the items so that each have a single foo1.x and foo1.y. downside is it creates reduncancies. and also you will have to group by title or something before rendering the hits – cmgchess Jan 23 '23 at 18:49
  • something similar caused due to this https://stackoverflow.com/questions/74381551/how-to-query-algolia-data-with-in-the-array-of-object – cmgchess Jan 23 '23 at 18:50
  • correction: from x and y i meant b1 and b2 – cmgchess Jan 26 '23 at 13:38

0 Answers0