You can use the Fulltext predicate to search a document for a given term or terms.
It searches the term(s) in any of the following fields:
- Rich Text
- Key Text
To learn more about this predicate checkout the Fulltext section on the Query Predicate Reference page.
Note that the fulltext search is not case sensitive.
The Fulltext predicate
Here is the predicate you need when querying all of the documents of a certain custom type.
You just need to enter the term(s) for the search. The following is the predicate that will query for all documents that contain the word "football".
Example with a single search term
The following example shows the url used to query all the documents of the custom type "blog-post" that contain the word "prismic".
Here are all the required parameters for this query:
all of type "blog-post"
search for "prismic"
Example with multiple search terms
The following example shows the url used to query all the documents of the custom type "article" that contain both the word "cookies" and "chocolate".
When searching multiple terms, the document must contain all the search terms. To enter multiple terms, simply put a space between the words as shown below.
Here is what the required parameters for this query look like:
all of type "article"
search for terms
Was this article helpful?
Can't find what you're looking for? Get in touch with us on our Community Forum.