# 3.5.9.Span 查询

Span查询是低级位置查询，可以提供对指定条款的顺序和接近度的专家控制。这些通常用于对法律文件或专利执行非常具体的查询。

Span查询不能与非跨查询（span\_multi查询除外）混合。

该组中的查询是：

**span\_term查询**

等同于term 查询，但与其他Span查询一起使用。

**span\_multi查询**

包含term, range, prefix, wildcard, regexp 或者 fuzzy 查询。

**span\_first查询**

接受另一个Span查询，其匹配必须出现在字段的前N个位置。

**span\_near查询**

接受多个Span查询，其匹配必须在彼此的指定距离内，并且可能以相同的顺序。

**span\_or查询**

组合多个Span查询 - 返回与任何指定查询匹配的文档。

**span\_not查询**

包装另一个Span查询，并排除与该查询匹配的任何文档。

**span\_containing查询**

接受Span查询的列表，但仅返回也匹配第二个Span查询的跨度。

**span\_within查询**

单个Span查询的结果将返回，只要其跨度位于由其他Span查询列表返回的范围内。

**field\_masking\_span查询**

允许跨越不同字段span-near 或者 span-or 的查询。


---

# 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://xiaoxiami.gitbook.io/elasticsearch/ji-chu/35query-dsldslfang-shi-cha-8be229/358span-cha-xun.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.
