Creates a query analysis rule. If you set the dryRun parameter to true, this operation checks the specified query analysis rule. The default value of the dryRun parameter is false if you do not set this parameter.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only common request headers. For more information, see Common request parameters.

Request syntax

POST /v4/openapi/app-groups/[appGroupIdentity]/apps/[appId]/query-processors HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
appGroupIdentity String Path Yes my_app_group_name

The name of the application.

appId Integer Path Yes 110157886

The ID of the version.

dryRun Boolean Query No true

Specifies whether the request is a dry run.

Request body

Parameter

Type

Required

Example

Description

name

String

Yes

"test"

The name of the query analysis rule.

processors[]

Object

Yes

--

The features that are used in the query analysis rule.

For more information, see the "Processor" section of the QueryProcessor topic.

domain

String

No

"GENERAL"

The type of the industry. Valid values:

  • GENERAL
  • ECOMMERCE
  • IT_CONTENT

indexes

Array

No

["default"]

The indexes to which the query analysis rule applies.

active

Boolean

No

true

Specifies whether the query analysis rule is enabled.

For more information, see QueryProcessor.

Response parameters

Parameter Type Example Description
requestId String 0A6EB64B-B4C8-CF02-810F-E660812972FF

The ID of the request.

result Struct

The information about the query analysis rule.

active Boolean true

Indicates whether the query analysis rule is the default one.

created Integer 1587398402

The time when the query analysis rule was created.

domain String GENERAL

The type of the industry. Valid values:

  • GENERAL
  • ECOMMERCE
  • IT_CONTENT
indexes List "default"

The indexes to which the query analysis rule applies.

name String query_filter

The name of the query analysis rule.

processors List {}

The features that are used in the query analysis rule.

updated Integer 1587398402

The time when the query analysis rule was last updated.

Examples

Sample requests

POST /v4/openapi/app-groups/os_function_test_v1/apps/110157886/query-processors

{
    "name": "query_filter",
    "domain": "GENERAL",
    "indexes": ["default"],
    "processors": [
        {
            "name": "synonym",
            "useSystemDictionary": true
        },
        {
            "name": "stop_word",
            "useSystemDictionary": true,
            "interventionDictionary": "helo"
        }
    ]
}

Sample success responses

XML format

<requestId>0A6EB64B-B4C8-CF02-810F-E660812972FF</requestId>
<result>
    <name>query_filter</name>
    <active>true</active>
    <indexes>default</indexes>
    <processors>
        <name>synonym</name>
        <useSystemDictionary>true</useSystemDictionary>
    </processors>
    <processors>
        <name>stop_word</name>
        <useSystemDictionary>true</useSystemDictionary>
        <interventionDictionary>980</interventionDictionary>
    </processors>
    <domain>GENERAL</domain>
    <created>1587398402</created>
    <updated>1587398402</updated>
</result>

JSON format

{
    "requestId": "0A6EB64B-B4C8-CF02-810F-E660812972FF",
    "result": {
        "name": "query_filter",
        "active": true,
        "indexes": "default",
        "processors": [
            {
                "name": "synonym",
                "useSystemDictionary": true
            },
            {
                "name": "stop_word",
                "useSystemDictionary": true,
                "interventionDictionary": 980
            }
        ],
        "domain": "GENERAL",
        "created": 1587398402,
        "updated": 1587398402
    }
}

Error codes

For a list of error codes, visit the API Error Center.