---
title: "Search Suggest"
method: GET
path: "/api/search/suggest"
tags: ["search"]
---

# Search Suggest

`GET /api/search/suggest`

## Request

- Base URL: `https://fojin.app` (the document declares no server; this is the origin it was published from)
- URL: `https://fojin.app/api/search/suggest`
- Auth: none declared

Return autocomplete suggestions across multiple sources.

Ranking (2026-08-25 — before this, dictionary headwords sorted by length
always came first, so "金刚" produced 金刚/金刚石/金刚砂/金刚宝石 and the
site's most-searched sutra 《金刚经》 was not in the list at all):

1. canonical titles whose alias starts with the query (services/search.py
   ``_SUTRA_ABBREV`` — shared with retrieval and search)
2. exact dictionary headword ("苦" still surfaces the entry 苦 first)
3. ES title prefix matches (sutra titles & translators)
4. dictionary prefix headwords (金刚石 …)
5. hot_questions containing the query

Each item carries a ``type`` (title / term / question) so the homepage can
group the dropdown; ``suggestions`` stays a flat string list for the search
page. Deduplicated, at most 10.

根据输入返回搜索建议（自动补全）：正典经名 > 精确词头 > 经名 > 前缀词头 > 精选问题。

## Query parameters

- `q` string, required: 搜索建议关键词

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/fojin/apis/fojin-api-buddhist-digital-text-platform.md) · [All operations](https://skmtc.dev/fojin/apis/fojin-api-buddhist-digital-text-platform/llms.txt) · [OpenAPI document](https://skmtc.dev/fojin/apis/fojin-api-buddhist-digital-text-platform/revisions/969714238c61?raw)
