Custom Search Suggestions

Topic summary

Goal: return a custom suggest.json via a Liquid template that outputs search.results (body only) using search.suggest.liquid.

Attempts and findings:

  • /search.suggest?type=page,article&q=about%20us* → no visible results.
  • /search/suggest?type=page,article&q=about%20us* → appears to be the correct path, but returns “Invalid parameter error: Missing section_id param.”
  • Adding section_id (e.g., section_id=0 or 1) → “Section not found: Section id 0 was not found in the theme.”

Context: The same query on the standard search page returns results, so the query itself is valid; the issue is accessing/rendering the custom suggest template.

Key terms:

  • suggest.json: a JSON endpoint for search suggestions (e.g., pages, articles).
  • section_id: a parameter tied to theme sections that the endpoint expects.

Status: No resolution yet. The user is seeking a way to reach the custom template or bypass the required section_id to return custom JSON suggestions. Unanswered question: how to correctly invoke search.suggest.liquid without theme section errors.

Summarized with AI on January 26. AI used: gpt-5.

Hi,

I want to create a page that returns a custom suggest.json.

I’ve created a very basic search template that should show results from a query with just the body of each.

Template: search.suggest.liquid

{% layout none %}

{% for item in search.results %}
  <p>{{ item.body }}</p>
{% endfor %}

But I don’t know how to reach this template, I’ve tried the following:

/search.suggest?type=page,article&q=about%20us*

/search/suggest?type=page,article&q=about%20us*

But I don’t see results for either. When using the same query on the search page it returns results, so I know this query should work.

Any ideas?

Thanks,

Stu

I’m getting some kind of result using /search/suggest?type=page,article&q=about%20us* suggesting that this is the correct syntax but it’s returning an error:

Invalid parameter error: Missing section_id param

If I try using a section_id parameter of 0 or 1 I get another error /search/suggest?type=page,article&q=about%20us*&section_id=0

Section not found: Section id 0 was not found in the theme

Any ideas on a way around this?

Thanks