# 9.3.5 Search API概览

## Search API

* URI Search
  * 在URL中使用查询参数
* Request Body Search
  * 使用Elasticsearch提供的，基于JSON格式的更加完备的Query Domain Specific Language （DSL）

### 指定查询的索引

![](/files/-LoOymI8EnaRJ6drjyw4)

### URI查询

* 使用"q"，指定查询字符串
* "query string syntax"，KV键值对

举例

![](/files/-LoOymIAfjurM60u67Pk)

### Request Body

![](/files/-LoOymICabCoLSl8N8v5)

### 搜索Response字段说明

![](/files/-LoOymIEEFyS7dWDG4vu)

## 衡量相关性

* Information Retrieval（检索）
  * Rrecision（查准率） - 尽可能返回较少的无关文档
  * Recall （查全率）- 尽量返回较多的相关文档
  * Ranking - 是否能够按照相关度进行排序

![](/files/-LoOymITxeQu1UjecbXO)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.clay-wangzhi.com/9-elasticsearch/9.3-elasticsearch-ru-men/9.3.5-search-api-gai-lan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
