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

Sort by _id can break over multi-collection indexes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Known Error
    • Major
    • None
    • 7.0.0
    • fts
    • Untriaged
    • 1
    • Unknown

    Description

      Multi-collection indexes have scoreUID+collectionUID prefixed to the key - the _id stored within the index. While docID searches work ok, sorting still happens to use the prefixed key - which could cause results to be in an unexpected order if the query were to span multiple collections.

      Hits will be grouped and sorted by collections and within those collections, they will be sorted correctly.

      For example ..

      Document Bucket.Scope.Collection
      doc1 bucket.scope.coll2
      doc2 bucket.scope.coll1
      doc3 bucket.scope.coll2
      doc4 bucket.scope.coll1

      If all the documents above qualify some search criteria which orders it by "_id", the hits will be ordered this way ..

      1.    doc2
      2.    doc4
      3.    doc1
      4.    doc3 

      Attachments

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

        Activity

          People

            abhinav Abhi Dangeti
            abhinav Abhi Dangeti
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty