v3-search-suggest.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-search-suggest.yaml
  2. get:
  3. summary: 搜索建议(自动补全)
  4. tags:
  5. - search-suggest
  6. operationId: get_api_v3_search_suggest
  7. description: |-
  8. 按前缀给出补全候选,供搜索框实时提示。每个字段各自返回一组建议。
  9. q 为空时返回 400。
  10. 实现:`V3\SearchSuggestController@index`
  11. security:
  12. - { }
  13. -
  14. bearerAuth: []
  15. parameters:
  16. -
  17. name: q
  18. in: query
  19. schema:
  20. type: string
  21. default: ''
  22. description: 已输入的查询文本
  23. required: true
  24. -
  25. name: fields
  26. in: query
  27. schema:
  28. type: string
  29. enum:
  30. - title
  31. - content
  32. - page_refs
  33. description: 在哪些字段上补全,逗号分隔;不传则全查
  34. -
  35. name: language
  36. in: query
  37. schema:
  38. type: string
  39. description: 语言过滤
  40. example: pali
  41. -
  42. name: limit
  43. in: query
  44. schema:
  45. type: integer
  46. default: 10
  47. description: '每个字段返回的建议数,上限 50'
  48. responses:
  49. 200:
  50. description: 成功
  51. content:
  52. application/json:
  53. schema:
  54. type: object
  55. properties:
  56. data:
  57. type: array
  58. items:
  59. type: object
  60. meta:
  61. $ref: '../../main.yaml#/components/schemas/PaginationMeta'
  62. 422:
  63. $ref: '../../main.yaml#/components/responses/ProblemValidation'