Hi, I have read the REST API document and I would like to use predicate query to fetch document which has certain string in a field in Slice repeatable zone.
Following image is my slice. The field type is Key Text and the field api id is tag.
Editor might add multiple "tag" and I want to check if any of their value match a string typed by end user.
My custom type is post, and the Slice id is tags.
Here's my current query way:
I would like to return the whole document that matches the fulltext query. Just like what other query predicate gets from their response.
I have tried using the API browser before. However I don't know how to correctly write a query to search documents in certain language with API browser. The query text always turns red wherever I put the lang filer.
Would you also give an example for it? Since I can't find any using lang filer to do with API browser example in your documents.
Our repository name is furbo-prismic-dev.
I have successfully searched my post document with language query string.
However, I can't get any document when I tried to search key text field tag in my tags slice
Followings are part of the result I searched post document by title filed.
The image shows tags slice content in the document. It has three key text in the slice
Yes the data structure of the screenshot you shared is the exact document I want to query from. By the way, could you remove or hide the sensitive information (ex. id) in it? Very thanks!
We want to do a function that users can click a tag then be redirected to the search result page to search blog post with the tag name. We would like to add many tags in the post document so we chose to create a tag slice instead of using Prismic original tagging system.
According to your answer, seems creating a tag slice is not a proper solution if querying slice items field with predicate is impossible.
Thanks for sharing this information, and I have removed the screenshot with sensitive info, and why don't you use the native tagging system or have custom-type tags for more customization where you can link to the tags documents with content relationship fields?
Really sorry for the late reply. Thanks for your suggestion.
As we would like to do a tag function that user can click the tag and led to the search page to search with the tag name, it's ideal to use predicate querying the posts which has a tag matching the term.
I've tried creating a custom-type tag document and added it as content relationship in my post doc. But it seemed I cannot use fulltext predicate to query content relationship field in a document. Neither the native tagging system can be queried by fulltext predicate.