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

A vector query in the UI should validate that the dimension of the query matches the index.

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • backlog
    • 7.6.0
    • fts
    • None
    • 0

    Description

      The UIs (both onprem and capells) when doing a query know the full syntax of the JSON index definition in particular for vector we have the following (assumes a vector definition on a field called "embedding":

       

       
            "embedding": {
             "enabled": true,
             "dynamic": false,
             "fields": [
              {
               "dims": 1536,
               "index": true,
               "name": "embedding",
               "similarity": "l2_norm",
               "type": "vector",
               "vector_index_optimized_for": "recall"
              }
             ]
            },
      

       

      as can be seen the "dims" value is 1536 now suppose that a query is about to be run from a UI as follows: 

       

      "knn": [
          {
            "k": 3,
            "field": "embedding",
            "vector": [
              0,
              0,
              0
            ]
          }
        ],
        "fields": [
          "*"
        ],
        "query": {
          "match_none": {}
        },
        "explain": true,
        "size": 10,
        "from": 0
      }

      The UI's JavaScript should check that a) a vector definition for the field "embedding" exists in the index definition and if it does compare the size of the query "vector" array to see if it matches the "dims" value in the definition if they don't match there is no point in running the misconfigured query.   

      In the example above 3 != 1536 so the query isn't legal from the start.

      Attachments

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

        Activity

          People

            abhinav Abhi Dangeti
            jon.strabala Jon Strabala
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty