🎤 Builder Talk: The Story Behind Lady Gaga’s Digital Experience – Register now

Searching documents in Sanity Studio using references and filters

5 replies
Last updated: Jan 21, 2025
Can I use Studio to search for documents based on reference? eg search Movies that have Tom Cruise?
Jan 18, 2025, 1:03 AM
Hi there👋
You can use GROQ in the vision tool with a query like this:

*[_type == "movie" && references(*[
  _type == "actor" && 
  name match "Tom Cruise"
]._id)]
Jan 21, 2025, 1:55 AM
yeah that part i figured out, i was wondering if it's possible straight up in the studio without GROQing
Jan 21, 2025, 2:05 AM
Just got a chance to test this. It look like you can use the main search with the "Contains document, image or file" filter to search for which type has a particular reference. In my case, I was able to find all drills that use cones. Please let me know if this is helpful!
Jan 21, 2025, 2:37 AM
Just got a chance to test this. It look like you can use the main search with the "Contains document, image or file" filter to search for which type has a particular reference. In my case, I was able to find all drills that use cones. Please let me know if this is helpful!
Jan 21, 2025, 2:38 AM
oh i see, main search, cool, i was looking at just document search 👍 thank you for validating this 🙏
Jan 21, 2025, 2:47 AM

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.

Was this answer helpful?