Troubleshooting search functionality issues in Sanity.io
13 replies
Last updated: Dec 6, 2021
K
I'm also experiencing an issue with the Search Functionality within Sanity where the search request is not returning anything. the
consoleshows a 400 error alongside some sort of invalid character issue, wondering if anyone has encountered something similar & managed to fix it? 😄
Nov 30, 2021, 7:11 PM
Hi User. We’ve seen it once recently. It came down to the use of brackets to access array elements in a preview rather than our required dot notation . Unfortunately, it broke search but didn’t prevent building the studio. I would start by searching your code base for a preview using something like:
and changing it to something (in this example) like:
The best approach is probably to search for
If that’s
not the case, please let us know.
obj.body[0].children[0].text
obj.body.0.children.0.text
preview: {.
If that’s
not the case, please let us know.
Nov 30, 2021, 8:14 PM
K
Thanks, User. So would I look for that in the
select: {part or
prepare()or either?
Nov 30, 2021, 9:10 PM
K
Thanks, User. So would I look for that in the
select: {part or
prepare()or either?
Nov 30, 2021, 9:10 PM
K
Thanks, User. So would I look for that in the
select: {part or
prepare()or either?
Nov 30, 2021, 9:10 PM
K
Can't seem to find anything 😞Wonder would it have something to do with me having
"__experimental_spaces"spaces enabled?
Nov 30, 2021, 9:33 PM
I don’t think that would cause this, but you never know.
Would you be willing to share your schema for us to take a look? The whole studio folder (minus node_modules) can be zipped and DMed.
Would you be willing to share your schema for us to take a look? The whole studio folder (minus node_modules) can be zipped and DMed.
Nov 30, 2021, 10:42 PM
K
Sure thing, I'll DM it to you now
Dec 1, 2021, 3:50 PM
K
Sure thing, I'll DM it to you now
Dec 1, 2021, 3:50 PM
Turned out to be a space in a
preview.selectvalue. I will log a feature request so that the errors returned are clearer (and help point the developer in the right direction).
Dec 6, 2021, 7:22 PM
Turned out to be a space in a
preview.selectvalue. I will log a feature request so that the errors returned are clearer (and help point the developer in the right direction).
Dec 6, 2021, 7:22 PM
Sanity– build remarkable experiences at scale
Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.