vespa-engine / vespa

AI + Data, online. https://vespa.ai
https://vespa.ai
Apache License 2.0
5.79k stars 604 forks source link

Support `in` filtering operation in `sameElement` #30711

Open wanliAlex opened 7 months ago

wanliAlex commented 7 months ago

Is your feature request related to a problem? Please describe. The in filtering operation is not supported in sameElement and the error message is misleading:

For example, if i have a field defined in schema as:

  field test_fields type map<string, string> {
      indexing: summary
      struct-field key { indexing : attribute
                         attribute: fast-search
                         rank: filter }
      struct-field value { indexing : attribute
                            attribute: fast-search
                            rank: filter }
  }

And we have a yql:

'yql': 'select * from test_index where TRUE  AND ((test_fields contains sameElement(key contains "test", value in ("test_1", "test_2"))))'

it will return an error

'Could not create query from YQL: The in operator is only supported for integer and string fields. The field value is not of these types',

Describe the solution you'd like I hope in operation is supported with sameElement

Describe alternatives you've considered n/a

Additional context n/a

baldersheim commented 7 months ago

This sounds like a bug. Could you supply your schema definition ?

wanliAlex commented 7 months ago

This sounds like a bug. Could you supply your schema definition ?

I have updated my description with the schema