Sorting with calculation result giver "Argument value is required" error
I have the following query:
In my resource I have these calculations:
When I run this query, I will get this error:
The query works fine I if remove the
similarity: desc
from the sort function.
Any idea why?7 Replies
Here is the full stacktrace of the error:
So, you're chaining calculations that require arguments, meaning you're going to have to thread them through
I think the misunderstanding is here:
Each calculation is evaluated independently of what is already loaded
Hmm, but in this case, why does the query works if I just don't add the sort line?
And I also tried that change and I still get the value is required error:
But now it says that it is in the sort
Yeah, so you need to provide the calculation arguments
What I think you want here:
The arguments need to be provided to the sort as well
Ah, I see
I guess I don't even need the load for the similarity in this case right?
Since sort will already load it
Sort won't load it
but it will sort by it
But the concepts are isolated
you don't have to load something to sort by it, and sorting by it won't load it
If you want both (to load it and sort by it) then you have to do both
got it, makes sense
thanks again 🙂