All Products
Search
Document Center

:fieldlen

Last Updated:Sep 09, 2021

Functionality functions

You can use functionality functions in filter clauses to define filter conditions. Functionality functions that return numeric values can be used in sort clauses for sorting.

The fields that you reference in the parameters of functionality functions must be configured as index or attribute fields based on the description of each function.

fieldlen: calculates the value length of a field of the LITERAL type

1.Syntax:

fieldlen(field_name)

2.Parameters:

field_name: the name of the field whose value length is to be calculated. The field can be of the LITERAL or ARRAY type.

3.Return value:

The value length of the field is returned. The return value is of the INT64 type. If the field is of the ARRAY type, the number of elements in the array is returned.

4.Scenarios:

Scenario 1: Use the following query clause to search for documents in which the value of the usr_name field is not empty:

query=default:'Keyword'&&filter=fieldlen(usr_name)>0

5.Usage notes:

  • The field that you reference in the parameter of the function must be configured as an attribute field.