Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-43999

FTS: Flex index - NOT LIKE query fails

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Cheshire-Cat
    • feature-backlog
    • fts
    • 1

    Description

      Build: 7.0.0-4322

      Having the following KV structure:

      `default`.scope1.collection1

      and set of 1000 docs loaded into collection1:

      {
        "mutated": 0,
        "join_date": "1982-11-24T01:57:56",
        "languages_known": [
          "English",
          "Chinese",
          "Quechua"
        ],
        "name": "Drucilla Jr.",
        "dept": "Finance",
        "salary": 131488,
        "type": "emp",
        "is_manager": false,
        "email": "Drucilla@mcdiabetes.com",
        "emp_id": "10000001"
      }
      

      and the following FTS index:

      {
       "name": "default_index_1",
       "type": "fulltext-index",
       "params": {
        "doc_config": {
         "docid_prefix_delim": "",
         "docid_regexp": "",
         "mode": "scope.collection.type_field",
         "type_field": "type"
        },
        "mapping": {
         "default_analyzer": "keyword",
         "default_datetime_parser": "dateTimeOptional",
         "default_field": "_all",
         "default_mapping": {
          "dynamic": false,
          "enabled": false
         },
         "default_type": "_default",
         "docvalues_dynamic": true,
         "index_dynamic": true,
         "store_dynamic": false,
         "type_field": "_type",
         "types": {
          "scope1.collection1": {
           "default_analyzer": "keyword",
           "dynamic": true,
           "enabled": true,
           "properties": {
            "type": {
             "enabled": true,
             "dynamic": false,
             "fields": [
              {
               "index": true,
               "name": "type",
               "type": "text"
              }
             ]
            }
           }
          }
         }
        },
        "store": {
         "indexType": "scorch",
         "mossStoreOptions": {},
         "segmentVersion": 15
        }
       },
       "sourceType": "gocbcore",
       "sourceName": "default",
       "sourceUUID": "91acd2e599b88e790c80341dcb1964db",
       "sourceParams": {},
       "planParams": {
        "maxPartitionsPerPIndex": 171,
        "indexPartitions": 6,
        "numReplicas": 0
       },
       "uuid": "285edb4a658c064b"
      }
      

      I'm trying to run the following query:

      select count(*) from `default`.scope1.collection1 USE INDEX(USING FTS) where type NOT LIKE '%emp'
      

      As a result, I'm getting the following response:

      [
        {
          "code": 4000,
          "msg": "No index available on keyspace `default`:`default`.`scope1`.`collection1` that matches your query. Use CREATE PRIMARY INDEX ON `default`:`default`.`scope1`.`collection1` to create a primary index, or check that your expected index is online.",
          "query": "select count(*) from `default`.scope1.collection1 USE INDEX(USING FTS) where type NOT LIKE '%emp'"
        }
      ]
      

      The following query

      select count(*) from `default`.scope1.collection1 USE INDEX(USING FTS) where type LIKE '%emp'
      

      executes successfully.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          Evgeny Makarenko We don't interpret NOT yet within FLEX. See documentation here ..

          https://docs.google.com/document/d/1vv1P7HJ_HIgPkVE5bkidEgNPZdAWe7W1Al3H2Kc8Dz0/edit#heading=h.r3gwy8i5wvq

          I'll need to check if I can extend support for cheshire-cat still on this. For now, i'll push this out to .next.

          abhinav Abhinav Dangeti added a comment - Evgeny Makarenko  We don't interpret NOT yet within FLEX. See documentation here .. https://docs.google.com/document/d/1vv1P7HJ_HIgPkVE5bkidEgNPZdAWe7W1Al3H2Kc8Dz0/edit#heading=h.r3gwy8i5wvq I'll need to check if I can extend support for cheshire-cat still on this. For now, i'll push this out to .next .

          I've removed NOT LIKE queries from tests for now.

          Later, if it will be required, NOT LIKE condition can be easily restored for testing. 

          evgeny.makarenko Evgeny Makarenko (Inactive) added a comment - I've removed NOT LIKE queries from tests for now. Later, if it will be required, NOT LIKE condition can be easily restored for testing. 

          People

            abhinav Abhinav Dangeti
            evgeny.makarenko Evgeny Makarenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty