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

[UI] Leading zeros in numeric content are not correctly handled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • 7.6.0
    • 7.6.0
    • fts
    • Enterprise Edition 7.6.0 build 2038

    Description

      • Load siftsmall dataset
      • Create FTS Index with the following indexDef:

      {
        "type": "fulltext-index",
        "name": "b1.s1.sift_index",
        "uuid": "2a1c1eca394924e4",
        "sourceType": "gocbcore",
        "sourceName": "b1",
        "sourceUUID": "eebe3c9a317adbae9a21ead5951c3435",
        "planParams": {
          "maxPartitionsPerPIndex": 1024,
          "indexPartitions": 1
        },
        "params": {
          "doc_config": {
            "docid_prefix_delim": "",
            "docid_regexp": "",
            "mode": "scope.collection.type_field",
            "type_field": "type"
          },
          "mapping": {
            "analysis": {},
            "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": {
              "s1.c1": {
                "dynamic": true,
                "enabled": true,
                "properties": {
                  "vector_data": {
                    "dynamic": false,
                    "enabled": true,
                    "fields": [
                      {
                        "dims": 128,
                        "index": true,
                        "name": "vector_data",
                        "similarity": "l2_norm",
                        "type": "vector",
                        "vector_index_optimized_for": "recall"
                      }
                    ]
                  }
                }
              }
            }
          },
          "store": {
            "indexType": "scorch",
            "segmentVersion": 16
          }
        },
        "sourceParams": {}
      }

      * Run the following query : 

      {    "query":{       "match_none":{        }    },    "explain":true,    "knn":[{       "field":"vector_data",       "k":2,       "vector":[0.0,34.0,46.0,3.0,1.0,6.0,27.0,44.0,0.0,9.0,77.0,32.0,37.0,83.0,41.0,3.0,19.0,14.0,15.0,17.0,18.0,34.0,22.0,22.0,12.0,23.0,52.0,12.0,0.0,0.0,0.0,1.0,8.0,22.0,15.0,16.0,16.0,35.0,92.0,94.0,1.0,3.0,9.0,13.0,22.0,120.0,120.0,12.0,120.0,15.0,5.0,0.0,0.0,39.0,74.0,120.0,115.0,24.0,14.0,7.0,2.0,7.0,4.0,34.0,1.0,18.0,36.0,120.0,41.0,10.0,2.0,0.0,1.0,8.0,93.0,120.0,35.0,21.0,7.0,0.0,120.0,104.0,57.0,7.0,0.0,1.0,2.0,20.0,120.0,51.0,2.0,13.0,18.0,12.0,3.0,20.0,7.0,6.0,9.0,18.0,18.0,24.0,19.0,4.0,5.0,12.0,114.0,71.0,13.0,2.0,0.0,2.0,60.0,30.0,81.0,54.0,0.0,0.0,0.0,13.0,44.0,10.0,1.0,3.0,7.0,15.0,20.0,38.0]    }] } 

      Note the 0th index of vector is 0.0
      This correctly returns the result.

      • Now if I change the number to 00.0 or any other trailing zeros in non decimal part, I don't get any results

       

      curl --location 'http://172.23.107.67:8094/api/index/b1.s1.sift_index/query' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA==' \
      --data '{
          "query": {
              "match_none": {}
          },
          "explain": true,
          "knn": [
              {
                  "field": "vector_data",
                  "k": 3,
                  "vector": [00.0,34.0,46.0,3.0,1.0,6.0,27.0,44.0,0.0,9.0,77.0,32.0,37.0,83.0,41.0,3.0,19.0,14.0,15.0,17.0,18.0,34.0,22.0,22.0,12.0,23.0,52.0,12.0,0.0,0.0,0.0,1.0,8.0,22.0,15.0,16.0,16.0,35.0,92.0,94.0,1.0,3.0,9.0,13.0,22.0,120.0,120.0,12.0,120.0,15.0,5.0,0.0,0.0,39.0,74.0,120.0,115.0,24.0,14.0,7.0,2.0,7.0,4.0,34.0,1.0,18.0,36.0,120.0,41.0,10.0,2.0,0.0,1.0,8.0,93.0,120.0,35.0,21.0,7.0,0.0,120.0,104.0,57.0,7.0,0.0,1.0,2.0,20.0,120.0,51.0,2.0,13.0,18.0,12.0,3.0,20.0,7.0,6.0,9.0,18.0,18.0,24.0,19.0,4.0,5.0,12.0,114.0,71.0,13.0,2.0,0.0,2.0,60.0,30.0,81.0,54.0,0.0,0.0,0.0,13.0,44.0,10.0,1.0,3.0,7.0,15.0,20.0,38.0
              }
          ]
      }'

      Response:

      { "error": "rest_index: Query, indexName: b1.s1.sift_index, err: bleve: QueryBleve parsing queryCtlParams, err: cbgt.QueryCtlParams: readFloat32: leading zero is invalid, error found in #10 byte of ...|vector\": [00.0,34.0,|..., bigger context ...|data\",\n \"k\": 3,\n \"vector\": [00.0,34.0,46.0,3.0,1.0,6.0,27.0,44.0,0.0,9.0,77.0,|...", "request": "{\n \"query\": {\n \"match_none\": {}\n },\n \"explain\": true,\n \"knn\": [\n {\n \"field\": \"vector_data\",\n \"k\": 3,\n \"vector\": [00.0,34.0,46.0,3.0,1.0,6.0,27.0,44.0,0.0,9.0,77.0,32.0,37.0,83.0,41.0,3.0,19.0,14.0,15.0,17.0,18.0,34.0,22.0,22.0,12.0,23.0,52.0,12.0,0.0,0.0,0.0,1.0,8.0,22.0,15.0,16.0,16.0,35.0,92.0,94.0,1.0,3.0,9.0,13.0,22.0,120.0,120.0,12.0,120.0,15.0,5.0,0.0,0.0,39.0,74.0,120.0,115.0,24.0,14.0,7.0,2.0,7.0,4.0,34.0,1.0,18.0,36.0,120.0,41.0,10.0,2.0,0.0,1.0,8.0,93.0,120.0,35.0,21.0,7.0,0.0,120.0,104.0,57.0,7.0,0.0,1.0,2.0,20.0,120.0,51.0,2.0,13.0,18.0,12.0,3.0,20.0,7.0,6.0,9.0,18.0,18.0,24.0,19.0,4.0,5.0,12.0,114.0,71.0,13.0,2.0,0.0,2.0,60.0,30.0,81.0,54.0,0.0,0.0,0.0,13.0,44.0,10.0,1.0,3.0,7.0,15.0,20.0,38.0] \n }\n ]\n}", "status": "fail"}
      

      00.0 is a valid float number.

      Even if this is expected then this error is not returned on the UI.

       

      Attachments

        1. Screenshot 2024-01-30 at 11.43.03 AM.png
          38 kB
          Abhi Dangeti
        2. Screenshot 2024-01-30 at 11.40.17 AM.png
          53 kB
          Abhi Dangeti
        3. Screenshot 2024-01-30 at 11.24.50 AM.png
          26 kB
          Abhi Dangeti
        4. image-2024-01-30-23-50-49-663.png
          259 kB
          Sarthak Dua
        5. Screenshot 2024-01-30 at 10.16.44 AM.png
          36 kB
          Abhi Dangeti
        6. image-2024-01-30-21-20-02-715.png
          303 kB
          Sarthak Dua
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sarthak.dua Sarthak Dua
            sarthak.dua Sarthak Dua
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty