Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-11389

Case sensitive in LIKE query althogh index created with false

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Low
    • Resolution: Not A Bug
    • 3.11.5
    • Feature/SASI

    Description

      I created an index on user's first name as following:

      CREATE CUSTOM INDEX ON users (first_name) USING 'org.apache.cassandra.index.sasi.SASIIndex'
      with options = {
      'mode' : 'CONTAINS',
      'case_sensitive' : 'false'
      };

      This is the data I have in my table
      user_id | first_name | last_name
      -----------------------------------------------------------------------------
      daa312ae-ecdf-4eb4-b6e9-206e33e5ca24 | Shlomo | Cohen
      ab38ce9d-2823-4e6a-994f-7783953baef1 | Elad | Karakuli
      5e8371a7-3ed9-479f-9e4b-e4a07c750b12 | Alon | Levi
      ae85cdc0-5eb7-4f08-8e42-2abd89e327ed | Gil | Elias

      Although i mentioned the option 'case_sensitive' : 'false'
      when I run this query :

      select user_id, first_name from users where first_name LIKE '%shl%';

      The query returns no results.
      However, when I run this query :

      select user_id, first_name from users where first_name LIKE '%Shl%';

      The query returns the right results,
      and the strangest thing is when I run this query:

      select user_id, first_name from users where first_name LIKE 'shl%';

      suddenly the query is no more case sensitive and the results are fine.

      Attachments

        Activity

          People

            xedin Pavel Yaskevich
            alon0230 Alon Levi
            Pavel Yaskevich
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: