-3

I am trying to use Opensearch provided regex function to count records(in json format) which have any value matching with given regex for the given field. Means, attributes.cat_specs.item_name contains any alphabet characters.

But some how query does not work after adding clause marked in bold . Please suggest if query needs modification.Thanks in advance.

Service name -Opensearch V2.6.0 URL: http://localhost:9200/_plugins/_sql Method: POST Request Body { "query": "SELECT count(*) FROM index_name WHERE companyName = 'devsanity' AND containerName = 'catalog' AND (('attributes.cat_specs.item_name' REGEXP '[a-z]'))" } Response body: { “error”: { “reason”: “Invalid SQL query”, “details”: “and function expected {[BOOLEAN,BOOLEAN]}, but get [BOOLEAN,INTEGER]”, “type”: “ExpressionEvaluationException” }, “status”: 400 }

0 Answers0