Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Query maps where value is case_sensitive=false #406

@ayashjorden

Description

@ayashjorden

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions