Http /search endpoint - use ANY on MVA not working?

Hi,

according to the documentation, this should work:

  1. curl localhost:9308/sql -d “mode=raw&query=CREATE TABLE product(title text, product_codes multi)”
  2. curl localhost:9308/sql -d “mode=raw&query=insert into product(title, product_codes) values (‘test’,(1,2,3,4))”
  3. curl -XPOST -H"Content-type:application/json" localhost:9308/search -d ‘{
    “index”: “product”,
    “query”:
    {
    “match_all”: {},
    “equals” : { “any(product_codes)”: 3 }
    }
    }’

However, I am getting an error: {“error”:“index product: Sphinx expr: syntax error, unexpected ‘)’ near ‘’”}

If I remove any I get correct result with a warning:

{“took”:0,“timed_out”:false,“warning”:{“reason”:“index product: use an explicit ANY()/ALL() around a filter on MVA column”},“hits”:{“total”:1,“hits”:[{“_id”:“1658744695074848771”,“_score”:1,“_source”:{“product_codes”:[1,2,3,4],“title”:“test”}}]}}

This is actually how I discovered that manticoresearch-java client needs a warning field in SearchResponse.

Am I missing something here?

What version of manticore are you using?

Pretty sure there has been updated recently around this, possily your version is too old.

[Thu Jan 6 10:49:00.632 2022] [1] using config file '/etc/manticoresearch/manticore.conf' (9387 chars)...

starting daemon version '4.2.0 15e927b28@211223 release' ...

listening on all interfaces for mysql, port=9306

This was also the case on 3.6 version.

we just fixed ANY \ ALL MVA filter condition at JSON request at f45b337b5c265433bb7d6262ad65d02f65edbaf3 you could grab daemon package from our dev repo to get this issue fixed

Example:

➜  ~ curl -sXPOST -H"Content-type:application/json" localhost:9308/search -d '{
"index": "product",
"query":
{
"match_all": {},
"equals" : { "any(product_codes)": 3 }
}
}'|jq .
{
  "took": 0,
  "timed_out": false,
  "hits": {
    "total": 1,
    "total_relation": "eq",
    "hits": [
      {
        "_id": "1514856549070143661",
        "_score": 1,
        "_source": {
          "product_codes": [
            1,
            2,
            3,
            4
          ],
          "title": "test"
        }
      }
    ]
  }
}

Same error occurs when using “range” filter on HTTP /search.
{“range”: {“any(attribute_name)”: {“lt”: 0}}} doesn’t work
Manticore version 6.0.4