Fulltext Search

You can use the Fulltext predicate to search a document for a given term or terms.

Before Reading

This page assumes that you've already imported the Prismic library and retrieved the Client object. If you want to learn how to do this, then refer to the How to Query the API page.

The fulltext predicate searches the term in the following fields:

  • Rich Text
  • Title
  • Key Text
  • UID
  • Select Fields.

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.

Example Query

The following example shows how to query all the documents of the custom type "blog_post" that contain the word "prismic".

    Prismic.Predicates.at('document.type', 'blog_post'),
    Prismic.Predicates.fulltext('document', 'prismic')
]).then(res => {
    // res is the response object, res.results holds the documents

Was this article helpful?
Not really
Yes, Thanks

Can't find what you're looking for? Get in touch with us on our Community Forum.