Search by Content

Last edit: Jun 05, 2019
  • Contributors:
  • pavelloz
  • lemingos
  • diana-lakatos

You can search for a page based on its content. For example, this might be helpful for creating search for the FAQ page.
Search will work on the rendered page version, so this page can't rely on any dynamic data, ie. current_user or URL params.

Page needs to be marked as searchable: true:

---
...
slug: tutorials/pages/search-by-content
searchable: true
---
...

Search query:

query search_page(
  $value: String
) {
  pages: pages(
    filter: {
      content: {
        contains: $value
      }
    }
  ) {
    total_entries
    results {
      slug
      content
    }
  }
}

Questions?

We are always happy to help with any questions you may have.