A QueryProcessor defines a query analysis rule for an OpenSearch application. It specifies which processors to apply, which indexes the rule targets, and whether the rule is the active default.
Structure
{
"name": "qp_lsh_test_1",
"domain": "GENERAL",
"processors": [{
"name": "stop_word",
"use_system_dictionary": true,
"intervention_dictionary": ""
}],
"indexes": [
"default"
],
"active": true
}| Field | Type | Description |
|---|---|---|
name | String | The name of the query analysis rule. Can contain lowercase letters, digits, and underscores (_). Must start with a lowercase letter. Maximum 16 characters. |
domain | String | The industry domain the rule applies to. Valid values: GENERAL, ECOMMERCE, IT_CONTENT. |
processors[] | Object | The processors to apply in this rule. Each entry is a Processor object. See Processor below. |
indexes | Array | The indexes this rule applies to. |
active | Boolean | Whether this rule is the default query analysis rule. |
Processor
A processor defines a single query analysis feature and its configuration.
OpenSearch supports six processor types:
| Processor name | Feature |
|---|---|
stop_word | Stop word filtering |
spell_check | Spelling correction |
term_weighting | Term weight analysis |
synonym | Synonym configuration |
category_prediction | Category prediction — see Category prediction |
ner | Named Entity Recognition (NER) — see NER |
Fields
{
"name": "stop_word",
"use_system_dictionary": true,
"intervention_dictionary": ""
}| Field | Type | Description |
|---|---|---|
name | String | The processor type. Valid values: stop_word, spell_check, term_weighting, synonym, category_prediction, ner. |
use_system_dictionary | Boolean | Specifies whether to use built-in dictionaries. |
intervention_dictionary | String | The name of the intervention dictionary. Leave blank if not applicable. |
Category prediction
Use the category_prediction processor to apply a trained category prediction model.
Fields
{
"name": "stop_word",
"categoryPrediction": 12345,
"projectId": 12346
}| Field | Type | Description |
|---|---|---|
name | String | Must be category_prediction. |
categoryPrediction | Integer | The ID of the category prediction model. |
projectId | Integer | The ID of the algorithm project. |
NER
Use the ner processor to apply Named Entity Recognition (NER) and control the priority of recognized entity types.
Fields
{
"name": "stop_word",
"use_system_dictionary": true,
"intervention_dictionary": "",
"priorities": [{
"priority": "HIGH",
"tag": "test",
"order": 1
}]
}| Field | Type | Description |
|---|---|---|
name | String | Must be ner. |
use_system_dictionary | Boolean | Specifies whether to use built-in dictionaries. |
intervention_dictionary | String | The name of the intervention dictionary. Leave blank if not applicable. |
priorities[] | Object | Priority settings for entity types. |
priorities[].priority | String | The priority level. Valid values: HIGH, MIDDLE, LOW. |
priorities[].tag | String | The internal name of the entity type. |
priorities[].order | Integer | The rank within entity types that share the same priority level. A lower value means higher priority. Default: 0. |
该文章对您有帮助吗?