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.
in or notin: judges whether field values are in a specific list
field: the name of the field to be judged. Only fields of the INT or FLOAT type are supported. Fields of the ARRAY, LITERAL, or TEXT type and the analyzer for fuzzy searches are not supported.
number N: the elements in a set. Separate multiple elements with vertical bars (|). Each element must be a string.
true or false
Scenario 1: Retrieve documents that contain "iphone" and the type field whose value is 1, 2, or 3. The type field must be of the INT type.
Scenario 2: Retrieve documents that contain "iphone" and the type field whose value is not 1, 2, or 3. The type field must be of the INT32 type.
The field that you reference in the parameters of the functions must be configured as an attribute field.
If you use the in or notin function in filter clauses, you cannot use fields of the ARRAY type. Otherwise, an syntax error is returned. The error code is 6141 and the error message is Filter clause syntax error.
Both the in(field, "number1|number2") function and the (field = number1) OR (field = number2) syntax can judge whether field values are in a specific list. However, the in function performs better. This rule also applies to the notin function.