Hi all,
has anyone come across an “invalid argument” error similar to the below:
Error: [
{
"position": [
"intersection"
],
"code": "invalid argument",
"description": "Sets are not compatible."
}
]
The call I was running was looking for the Intersection
of two indexes of the same collection as below:
Intersection(
Match(Index(Concat(["sortRecipeByRelevanceFor", "ujyvsaqlwg"]))),
Match(Index("findRecipeByAllergen"), "egg")
)
Indexes are defined and evaluated accordingly:
Index #1
{
name: "sortRecipeByRelevanceForujyvsaqlwg",
serialized: true,
source: "Recipe",
values: [
{
binding: "sort_result",
reverse: true
},
{
field: ["data", "recipe_processed"]
},
{
field: ["data", "title"]
},
{
field: ["data", "url"]
},
{
field: ["data", "image"]
},
{
field: ["data", "diet"]
},
{
field: ["data", "contributor"]
},
{
field: ["data", "allergens"]
},
{
field: ["data", "potential_allergens"]
},
{
field: ["ref"]
}
]
}
Match(Index(Concat(["sortRecipeByRelevanceFor", "ujyvsaqlwg"])))
{
"@set": {
match: Index("sortRecipeByRelevanceForujyvsaqlwg")
}
}
Index #2
{
name: "findRecipeByAllergen",
unique: false,
serialized: true,
source: "Recipe",
terms: [
{
field: ["data", "allergens"]
}
]
}
Match(Index("findRecipeByAllergen"), "egg")
{
"@set": {
match: Index("findRecipeByAllergen"),
terms: "egg"
}
}
I feel it’s there is definitely something I’m missing though it is not obvious to me. Any help welcome.