Skip to content

Commit

Permalink
fix: expose _id, assetId and url in default input search
Browse files Browse the repository at this point in the history
  • Loading branch information
robinpyon committed Oct 26, 2021
1 parent 6b0e527 commit 0f7d544
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/constructFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ const constructFilter = ({
// It's possible to add this by adding the following line to the searchQuery, but it's quite slow
// references(*[_type == "media.tag" && name.current == "${searchQuery.trim()}"]._id)
...(searchQuery
? [groq`[altText, description, originalFilename, title] match '*${searchQuery.trim()}*'`]
? [
groq`[_id, altText, assetId, description, originalFilename, title, url] match '*${searchQuery.trim()}*'`
]
: []),
// Search facets
...searchFacetFragments
Expand Down

0 comments on commit 0f7d544

Please sign in to comment.