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

Getting more than k results while doing knn with an extra where clause, involving FTS + GSI indexes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 7.6.1
    • fts, query
    • None
    • Capella (Free Trial as well as Dev)
    • Untriaged
    • 0
    • Unknown

    Description

      I was following this document to demonstrate Vector Search using SQL++. https://docs.google.com/document/d/1b6DxJ308w9kFyr0OxcDtNGgwl--p3dsTws-vIMWLMCQ/edit?usp=sharing
      After following all the previous steps,
      At Page 11 - I ran the query:

      SELECT color, brightness
      FROM `vector-sample`.color.rgb AS t1
      WHERE
        brightness >= 180 AND brightness <= 190
      AND
      SEARCH(t1, {
       "query": {  "match_none": {} },
       "knn": [{ "field": "colorvect_l2", "vector": [135,204,232],"k": 3 }]
      }
      )

      It gives correct 2 results which is expected behavior. 
      Then, I used suggest index feature and created an index using
      `CREATE INDEX adv_brightness ON `default`:`vector`.`color`.`rgb`(`brightness`)`

      However, When I tried to re-run the query, I am getting 9 results. But as there is an AND predicate, this should not have happened. Moreover the results don't seem correct as the expected results are also shown at the bottom and other results are given priority.

      Please let me know if anything else is required from my end.

      Attachments

        Issue Links

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

          Activity

            People

              abhinav Abhi Dangeti
              lokesh.goel Lokesh Goel
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty