Leon Wolf
08/28/2024, 2:45 PMKishore Nallan
08/28/2024, 2:56 PMLeon Wolf
08/28/2024, 2:57 PMKishore Nallan
08/28/2024, 2:57 PMLeon Wolf
08/28/2024, 3:20 PM(animalData.count:>300 && animalData.name:=lion) || (animalData.count:>100 && animalData.name:=tiger)
• (animalData.count:>300 && animalData.name:=lion) || isLionDataNull:true
Schema
{
name: "animals_collection",
fields: [
{ name: "country", type: "string" },
{ name: "animalData", type: "object[]" },
{ name: "/^is.*DataNull$/", type: "bool" }
]
}
Data
[
{
country: "USA",
id: "1",
animalData: [
{ data: { count: 221 }, name: "Lion" },
{ data: { count: 915 }, name: "Tiger" }
],
isLionDataNull: false,
isTigerDataNull: false,
isElephantDataNull: true
},
{
country: "Canada",
id: "2",
animalData: [
{ data: { count: 915 }, name: "Tiger" },
{ data: { count: 821 }, name: "Elephant" }
],
isLionDataNull: true,
isTigerDataNull: false,
isElephantDataNull: false
}
];
I think what i will do is flatten the "animalData" object, as we only have ~10 entries there. I think that should work, although its not greatJason Bosco
08/28/2024, 4:19 PMLeon Wolf
08/28/2024, 4:36 PMLeon Wolf
08/28/2024, 4:37 PMJason Bosco
08/28/2024, 4:38 PMLeon Wolf
09/12/2024, 11:44 AMexists
approach, but encountered an issue with the algolia instantsearch client:
• how do i define such filters described here across multiple facets - e.g. lionsExist OR lion.data.count
or (lionsExist OR lion.data.count AND lion.data.avgAge) OR (...)
? The documentation says that in Algolia it is not permitted to do queries across formats like this. Is this fixed in the typesense adapter?
• Otherwise how we should best modify the instantsearch client to format the query into this format?Jason Bosco
09/13/2024, 12:21 AMfilter_by
parameter. But it needs to be in Typesense's filter format, and not Algolia's. With the configure widget for eg, you can pass a filters
prop and that will get passed verbatim to Typesense. You'd need to find an equivalent property in the widget you're using to set the filters
string, and use Typesense's filter_by
format in thereLeon Wolf
09/13/2024, 8:59 AMquery_by
stringJason Bosco
09/13/2024, 5:32 PMfilters
parameter, that gets passed through to Typesense as is.
So you want to find a way in Instantsearch, to set the filters
state value somehow