Search by Content
Last edit: Jun 24, 2022
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
:
---
...
searchable: true
---
...
Search query:
query search_page(
$value: String
) {
pages: pages(
filter: {
content: {
contains: $value
}
}
) {
total_entries
results {
slug
content
}
}
}