All Products
Search
Document Center

:Config clause

Last Updated:Mar 08, 2023

You can use the start_offset parameter to specify the document offset from which documents in the document set start to be returned. For example, if you browsed the first 20 documents in the returned document set that contains the mobile phone keyword and you want to continue browsing the remaining documents, you can set the start_offset parameter to 20. This way, you can browse documents from the twenty-first document. You can use the hit_number parameter to manage the number of documents that you want to return. For example, if a page in the front end displays up to 40 records, you can set the hit_number parameter to 40. This way, the number of documents returned is less than or equal to 40. Havenask provides the debugging feature. You can set the log_level parameter to different values to obtain the logs of different levels in the query process and scoring process. You can configure the qrs_chain_name and summary_profile_name parameters based on your business requirement. You can use these parameters to manage query statements and results and use the extra_kvpairs parameter to pass information to each plug-in. The following sections describe the syntax of config clauses.

  • Syntax

'config='config_clause

The following sample code provides the syntax of config_clause:

config_clause := config_descriptioncon [{',' config_descriptioncon}]

The following table describes the parameters that are used in config_descriptioncon.

Parameter

Valid value

Default value

Description

start

NUMBER

0

The offset value from which the system starts to return documents in the result set.

hit

NUMBER

10

The maximum number of documents that can be returned.

format

'xml' or 'protobuf' or 'fb_summary'

'xml'

The format of returned documents. Take note that the flatbuffers format is supported for independent phase-2 queries.

proto_format_option

summary_in_bytes or pb_matchdoc_format

0

The details of the format when the format parameter is set to protobuf. Only the summary_in_bytes value is supported. We recommend that you use the pb_matchdoc_format value for phase-1 queries.

trace

'FATAL' or 'ERROR' or 'INFO' or 'DEBUG' or 'WARN' or 'TRACE1' or 'TRACE2' or 'TRACE3'

N/A

The query process information that is displayed in the frontend.

rank_trace

'FATAL' or 'ERROR' or 'INFO' or 'DEBUG' or 'WARN' or 'TRACE1' or 'TRACE2' or 'TRACE3'

N/A

The output information about the scoring process of a document in the frontend.

kvpairs

WORDS '#' WORDS

N/A

The key-value pair. Separate multiple key-value pairs with semicolons (;), such as WORDS '#' WORDS; WORDS '#' WORDS; WORDS '#' WORDS.

qrs_chain

IDENTIFIER

'DEFAULT'

The name of the configured QRS chain.

summary_profile

IDENTIFIER

'DefaultProfile'

The name of the summary in the configuration.

analyzer

IDENTIFIER

N/A

The analyzer that you configured for the QRS. If you do not configure this parameter, the analyzer that is specified in the schema.json file is used for analysis. The file is used when an index is created. The specified value must be included in the analyzer.json file.

default_index

string

""

The default index that is used in this query. The default index is the same as the index that is specified in the query_config configuration item in the cluster configuration file. The index that you specify in a query is used as the default index. If you do not specify an index in the query, the index that is specified in the query_config configuration item is used.

default_operator

'AND' or 'OR'

""

The default operator that is used in the query. The default operator is the same as the operator that is specified in query_config configuration item in the cluster configuration file. If you specify an operator in the query, the operator specified in the query is preferentially used as the default operator. If you do not specify an operator in the query, the operator that is specified in the query_config configuration item is used.

timeout

NUMBER

0

The timeout period of the query. Unit: ms. The default value is 0. The value cannot be a negative number. When query requests are sent by using Asynchronous Remote Procedure Call (ARPC) and pb of RPC contains the optional timeout parameter, the actual timeout period of the query is determined based on the smaller value of the configured timeout parameter in the query string.

seek_timeout

NUMBER

0

The timeout period of the query seeking phase. Unit: ms. Default value: 0. By default, the specified timeout period multiplied by 0.7 is used as the seeking timeout period.

no_summary

no or yes

no

If this parameter is set to yes, only the phase-1 query is run and the summary is not queried.

dedup

no or yes

yes

If this parameter is set to yes, duplicates are automatically removed from the result based on the primary key. If this parameter is set to no, duplicates are not removed from the result.

result_compress

'no_compress' or 'z_default_compress' or 'z_speed_compress' or 'snappy' or 'lz4'

N/A

The compression type for the result that is returned from QRS. The no_compress value indicates that the result is not compressed. The z_default_compress value indicates that Z_DEFAULT_COMPRESSION of zlib is used to compress the result by default. z_speed_compress indicates that Z_BEST_SPEED of zlib is used to compress the result. The value of this parameter overwrites the compression type that is specified in the qrs.json file.

searcher_return_hits

NUMBER

0

The number of records that are returned by the searcher. If the value is 0, the records are returned based on the values of the start and hit parameters. This value cannot exceed 5,000.

actual_hits_limit

NUMBER

0

Specifies whether the value of the totalhits parameter is an actual value or an estimated value. If the actual number of returned records is less than the value of the actual_hits_limit parameter, the actual value is returned. If the actual number of returned records is more than the value of the actual_hits_limit parameter, the estimated value is returned. If the actual number of returned records is 0, the estimated number of records is returned. If the numeric_limits<uint32_t>::max() condition is met, the actual number of records is returned.

sourceid

string

N/A

Multiple replicas are available for indexes online. If you do not configure the sourceid parameter for replicas, a replica is randomly selected for each query. When an index is incrementally updated, the updated data may not be synchronized to all replicas. As a result, the most recent query result may not be returned. After the value of the sourceid parameter is specified, a replica is selected for the query based on the hash value of the sourceid parameter. In this case, the users who use the same value of the sourceid parameter can query the latest data. The value of the sourceid parameter is of the string type.

rerank_hint

BOOL

false

Specifies whether to perform the second scoring process for the query.

rank_size

NUMBER

0

The number of documents that are roughly sorted or the number of documents that are dynamically truncated based on the rank_size parameter. If the value is 0, the value in the configuration file is used.

rerank_size

NUMBER

0

If the number of finely sorted documents in the first scoring process is 0, the value in the configuration file is used.

total_rank_size

NUMBER

0

The sum of roughly sorted rows in all partitions or the number of documents that are truncated based on a dynamic index. If the value is 0, the value in the configuration file is used.

total_rerank_size

NUMBER

0

The sum of finely sorted rows in each partition. If the value is 0, the value in the configuration file is used.

index_switch_limit

NUMBER

numeric_limits<uint32_t>::max()

The number of documents that you can seek on the primary chain. If the value is numeric_limits<uint32_t>::max(), documents are not dynamically truncated based on the mechanism in which the query can be switched to the secondary chain.

fetch_summary_type

docid or pk or rawpk

docid

The method that is used to obtain the summary. The default value is the value of the docid parameter. You can also use the hash value or the original value of the primary key.

inner_result_compress (< V3.4)

'no_compress' or 'z_default_compress' or 'z_speed_compress' or 'snappy'

N/A

The compression type of the result in the engine. This parameter is used when the searcher returns the result to the proxy or QRS.

batch_score

no or yes

yes

Specifies whether to enable batch scoring in the rough sort process. By default, batch scoring in the rough sort process is enabled. Documents are scored only when the accumulated documents in the engine reach a specified number.

optimize_rank

no or yes

yes

Specifies whether to delay scoring in the rough sort process. By default, scoring in the rough sort process is delayed. If the number of roughly sorted documents is less than the number of finely sorted documents, the engine uses a delay algorithm on the roughly sorted documents.

optimize_comparator

no or yes

yes

Specifies whether to enable the expression for delayed scoring. By default, expressions are enabled for delayed scoring. If the expression contains multiple dimensions, the engine delays the scoring of some dimensions.

debug_query_key

string

""

Specifies whether to troubleshoot query conditions in the engine. When debug_query_key is not left empty, query conditions are troubleshooted.

no_tokenize_indexes

index_name1';'index_name2

""

The tokenization process does not need to be performed for the index specified in the query. Other processes such as normalization and stop word removal can still be performed.

research_threshold

NUMBER

0

If the number of records is less than the value of this parameter, the query is performed again.

fetch_summary_cluster

string

""

The cluster from which the summary is obtained. You can use this parameter to distinguish the cluster from which data is queried and the cluster from which the summary is obtained.

fetch_summary_group

string

""

The group from which the summary is obtained. This parameter is used only when the summary index group is configured.

ignore_delete

bool

true

Specifies whether to ignore access to deletemap when the summary is obtained. Specifies whether to ignore the deletion mark in deletionmap. If you set this parameter to true, the deleted documents can be obtained.

hit_summary_schema_cache_key

string

""

The cache key of the set of summary serialized fields on the QRS.

metrics_src

string

""

The src used to query metric statistics. This parameter is used together with the src whitelist configured in the qrs.json file.

join_type

'default' or 'strong' or 'weak'

'default'

The type of join operation that is performed on the secondary table in the query. In default mode, the method configured in the join_infos file is used to filter data in join operations. In strong mode, filter conditions in join operations are used for all secondary tables. If one secondary table fails to be joined, the document is discarded. In weak mode, join filtering is forcibly disabled.

sub_doc

'no' or 'group' or 'flat'

'no'

Specifies whether to enable the sub_doc mode for the query. For more information, see the sub_doc topic.

  • Example config=cluster:daogou,start:0,hit:10,format:xml,rank_trace:DEBUG,trace:INFO,kvpairs:title#xyz;name#abc&&query=notebook

This query statement queries "notebook" in the daogou cluster. The first ten records are obtained and displayed in XML format. The log of the INFO level for the query process and the log of the DEBUG level for the sort process can be obtained. The key-value pairs are title-xyz and name-abc.