All Products
Search
Document Center

:kvpairs_value

Last Updated:Mar 03, 2023

You can use feature functions in sort expressions. Most feature functions can be used only in fine sort expressions. You can combine various syntax and statements to perform complex sorts.

Feature functions

You can use feature functions in sort expressions. Most feature functions can be used only in fine sort expressions. You can combine various syntax and statements to perform complex sorts.

kvpairs_value: Returns the value of the specified field in a kvpairs clause in a query string

1. Syntax

kvpairs_value(query_key, type)

2. Parameters

  • query_key: the name of the field specified in the kvpairs clause.

  • type: the data type of the query_key field in the kvpairs clause. The following data types are supported: INT, FLOAT, and DOUBLE.

3. Examples

Scenario 1

The kvpairs clause of a query string contains the following information: query_key:10. The value of the query_key field is of the INT type. You want to obtain the value of the query_key field. In this case, use the following expression: kvpairs_value(query_key, INT).

Scenario 2

The kvpairs clause of a query string contains the following information: query_key:10.1. The value of the query_key field is of the FLOAT type. You want to obtain the value of the query_key field. In this case, use the following expression: kvpairs_value(query_key, FLOAT).

Scenario 3

The kvpairs clause of a query string contains the following information: query_key:10.12. The value of the query_key field is of the DOUBLE type. You want to obtain the value of the query_key field. In this case, use the following expression: kvpairs_value(query_key, DOUBLE).