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

Invalid mapping when filtering n1ql with a scoped fts with "_" prefix

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 7.2.3
    • fts
    • Untriaged
    • MacOSX 64-bit
    • 0
    • Unknown

    Description

      Executing the following query results in error :

      SELECT RAW meta().id
      FROM `09762c`.`_default`.`09762c_2` AS t
      WHERE SEARCH(t, "09762c_1", {"index": "repro"});

      Error : 

      [
        {
          "code": 5010,
          "msg": "Error evaluating filter",
          "reason": {
            "caller": "util:336",
            "code": 5000,
            "key": "Internal Error",
            "message": "n1fty: index mapping not found"
          }
        }
      ]

      The index definition :
      {
      "name": "repro",
      "type": "fulltext-index",
      "params": {
      "doc_config":

      { "docid_prefix_delim": "__", "docid_regexp": "", "mode": "scope.collection.docid_prefix", "type_field": "type" }

      ,
      "mapping": {
      "default_analyzer": "standard",
      "default_datetime_parser": "dateTimeOptional",
      "default_field": "_all",
      "default_mapping":

      { "dynamic": true, "enabled": false }

      ,
      "default_type": "_default",
      "docvalues_dynamic": false,
      "index_dynamic": true,
      "store_dynamic": false,
      "type_field": "_type",
      "types": {
      "_default.09762c_2": {
      "dynamic": false,
      "enabled": true,
      "properties": {
      "testUid": {
      "enabled": true,
      "dynamic": false,
      "fields": [

      { "docvalues": true, "include_in_all": true, "include_term_vectors": true, "index": true, "name": "testUid", "store": true, "type": "text" }

      ]
      }
      }
      }
      }
      },
      "store": {
      "indexType": "scorch",
      "segmentVersion": 15
      }
      },
      "sourceType": "gocbcore",
      "sourceName": "09762c",
      "sourceUUID": "ac6fc7e3c19f828650f38fa9c7cec65a",
      "sourceParams": {},
      "planParams": {
      "maxPartitionsPerPIndex": 1024,
      "indexPartitions": 1,
      "numReplicas": 0
      },
      "uuid": "25a7e9bbef1b4897"
      }
      If you change the prefix from __ to ::, everything works as expected.

      Here is a sample of documents so you can test this :

      [
        {
          "id": "09762c_1::0",
          "testUid": "09762c_1"
        },
        {
          "id": "09762c_1::1",
          "testUid": "09762c_1"
        },
        {
          "id": "09762c_1::2",
          "testUid": "09762c_1"
        },
        {
          "id": "09762c_1::3",
          "testUid": "09762c_1"
        },
        {
          "id": "09762c_1::4",
          "testUid": "09762c_1"
        },
        {
          "id": "09762c_1::5",
          "testUid": "09762c_1"
        },
        {
          "id": "09762c_1::6",
          "testUid": "09762c_1"
        },
        {
          "id": "09762c_1::7",
          "testUid": "09762c_1"
        },
        {
          "id": "09762c_1::8",
          "testUid": "09762c_1"
        },
        {
          "id": "09762c_1_0",
          "testUid": "09762c_1"
        },
        {
          "id": "09762c_1__0",
          "testUid": "09762c_1"
        }
      ]

       

      Attachments

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

        Activity

          People

            abhinav Abhi Dangeti
            JesusTheHun Jonathan MASSUCHETTI
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty