Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Query maps where value is case_sensitive=false #406

Open
ayashjorden opened this issue Dec 23, 2018 · 0 comments
Open

Query maps where value is case_sensitive=false #406

ayashjorden opened this issue Dec 23, 2018 · 0 comments

Comments

@ayashjorden
Copy link

Hello Stratio!
Thank you for this great library!
I've searched the issues for similar question as mine, but couldn't find any.
Also on SO, still nothing.

I'm trying to figure out how to query a Map<text, text> column, where I'd like that the match on the value would be case-insensitive.

My index:

CREATE CUSTOM INDEX index_v1 ON accounts () USING 'com.stratio.cassandra.lucene.Index' WITH OPTIONS = {'refresh_seconds': '1', 'schema': '{
      fields: {
        "meta_data": {type: "string"},
        "meta_data._key": {type: "string"},
        "meta_data._value": {type: "string", case_sensitive: false},
        "name":  {type: "string"}
      }
  }'};

For example, lets say that the Map contains Environment=Prd, The following query returns empty result:

SELECT * FROM accounts WHERE expr(index_v1, '{filter:{type:"match",field:"meta_data$Environment",value:"prd"}}');

UPDATE

Setting the "meta_data": {type: "string"} => "meta_data": {type: "string", case_sensitive: false}, did the trick. it queries the values case-insensitive.
BUT, I'm now curios about the following: querying keys is case sensitive, even though that the case_sensitive: false is at the meta_data level (over the whole map??).
Querying EnVironment=Prd will result in nothing.

Can you reason about this?

Appreciate your help,
Yarden

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant