CQMatch (open)

Create a match query

Syntax

LOADLIB "mod::consilio/lib/api.whlib";

RECORD FUNCTION CQMatch(STRING field, STRING matchtype, VARIANT value, RECORD options)

Parameters

STRING field

The field to search

STRING matchtype

How to match (possible values: 'IN', 'CONTAINS', '<', '<=', '=', '>=', '>')

VARIANT value

The value to match

RECORD options

Options

FLOAT boost

Factor to increase or decrease the score for this query (defaults to 1f)

Return value

RECORD

The match query

Description

This query can be used to match a field with a given value. The matching behaviour depends on the matchtype and the type of the value. For INTEGER and STRING values, matchtype "=" means a literal match and matchtype "CONTAINS" means a value match. For INTEGER ARRAY and STRING ARRAY values, matchtype "IN" means that the fields must contain at least one of the values and matchtype "CONTAINS" means that the field must contain all of the values. For DATETIME values, the matchtype can be one of "<", "<=", "=", "=>" or ">" to search for date ranges.