I have a "posts" data type, with an author
field on each post that links the post to an authors
data type. How can I rank with the score()
function posts that have a certain author?
On Sanity's website, the developers state:
score() cannot take a complex expression, including the use of functions (besides boost()), dereferencing, or subqueries.
Which adds to my suspicion that dereferencing will not work at all around the score function. Is there another way to search through dereferenced fields?
I've tried:
*[type == "posts"]{
"authorName": author->name
} | score(authorName match "John")
But receive only the error score() function received unexpected expression
.