# • 渗透表

透析表是一种特殊的表，用于存储查询而非文档。它用于前瞻性搜索或“反向搜索”。

* 要了解如何对透析表执行搜索查询，请参见[透析查询](/manticoresearch-manual-zh/5-sou-suo/percolate_query.md)部分。
* 要了解如何准备表以进行搜索，请参见[向透析表添加规则](/manticoresearch-manual-zh/data_creation_and_modification/xiang-biao-zhong-tian-jia-wen-dang/adding_rules_to_a_percolate_table.md)部分。

透析表的模式是固定的，包含以下字段：

| 字段      | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ID      | 一个带有自动递增功能的无符号 64 位整数。添加 PQ 规则时可以省略，如[添加 PQ 规则](/manticoresearch-manual-zh/data_creation_and_modification/xiang-biao-zhong-tian-jia-wen-dang/adding_rules_to_a_percolate_table.md)所述。                                                                                                                                                                                                                                                  |
| Query   | 规则的[全文查询](/manticoresearch-manual-zh/5-sou-suo/quan-wen-pi-pei/basic_usage.md)，可以视为[MATCH 子句](/manticoresearch-manual-zh/5-sou-suo/quan-wen-pi-pei/basic_usage.md)或[JSON /search](/manticoresearch-manual-zh/5-sou-suo/quan-wen-pi-pei/basic_usage.md#HTTP-JSON)的值。如果在查询中使用了[按字段操作符](/manticoresearch-manual-zh/5-sou-suo/quan-wen-pi-pei/operators.md)，则需要在透析表配置中声明全文字段。如果存储的查询仅用于属性过滤（没有全文查询），则查询值可以为空或省略。该字段的值应与创建透析表时指定的预期文档模式相对应。 |
| Filters | 可选。过滤器是一个可选字符串，包含属性过滤器和/或表达式，定义方式与[WHERE 子句](/manticoresearch-manual-zh/5-sou-suo/filters.md#WHERE)或[JSON 过滤](/manticoresearch-manual-zh/5-sou-suo/filters.md#HTTP-JSON)相同。该字段的值应与创建透析表时指定的预期文档模式相对应。                                                                                                                                                                                                                                  |
| Tags    | 可选。标签表示以逗号分隔的字符串标签列表，可用于过滤/删除 PQ 规则。当执行[透析查询](/manticoresearch-manual-zh/5-sou-suo/percolate_query.md)时，标签也可以与匹配的文档一起返回。                                                                                                                                                                                                                                                                                                               |

请注意，在创建透析表时，您不需要添加上述字段。

创建新透析表时，需要记住的是指定文档的预期模式，该模式将在您稍后添加的规则中进行检查。此过程与[其他本地表](/manticoresearch-manual-zh/creating_a_table/local_tables.md)的创建方式相同。

**通过 SQL 创建透析表：**

```sql
CREATE TABLE products(title text, meta json) type='pq';
```

```sql
Query OK, 0 rows affected (0.00 sec)
```

**通过 HTTP 使用 JSON 创建透析表：**

```json
POST /cli -d "CREATE TABLE products(title text, meta json) type='pq'"
```

```json
{
"total":0,
"error":"",
"warning":""
}
```

**通过PHP客户端创建透析表：**

```php
$index = [
    'index' => 'products',
    'body' => [
        'columns' => [
            'title' => ['type' => 'text'],
            'meta' => ['type' => 'json']
        ],
        'settings' => [
            'type' => 'pq'
        ]
    ]
];
$client->indices()->create($index);
```

```php
Array(
    [total] => 0
    [error] =>
    [warning] =>
)
```

**Python:**

```python
utilsApi.sql('CREATE TABLE products(title text, meta json) type=\'pq\'')
```

**Javascript:**

```javascript
res = await utilsApi.sql('CREATE TABLE products(title text, meta json) type=\'pq\'');
```

**java:**

```java
utilsApi.sql("CREATE TABLE products(title text, meta json) type='pq'");
```

**C#:**

```clike
utilsApi.Sql("CREATE TABLE products(title text, meta json) type='pq'");
```

**TypeScript:**

```typescript
res = await utilsApi.sql("CREATE TABLE products(title text, meta json) type='pq'");
```

**Go:**

```go
apiClient.UtilsAPI.Sql(context.Background()).Body("CREATE TABLE products(title text, meta json) type='pq'").Execute()
```

**通过配置文件创建透析表**

```ini
table products {
  type = percolate
  path = tbl_pq
  rt_field = title
  rt_attr_json = meta
}
```


---

# 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://vergil-lai.gitbook.io/manticoresearch-manual-zh/creating_a_table/local_tables/percolate_table.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.
