Uploaded image for project: 'Java Couchbase JVM Core'
  1. Java Couchbase JVM Core
  2. JVMCBC-1281

FTS: Wrong sort order when mixing SearchSort and String

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.4.6
    • None
    • None
    • None
    • 0
    • SDK16

    Description

      Suggested Release Note:

      Fixed a regression in Java SDK 3.4.5 that could cause Full-Text Search results to be sorted in the wrong order if the sort option was specified using a mix of strings and `SearchSort` objects.

      Example:

      cluster.searchQuery(
        "myIndex",
        SearchQuery.queryString("pool"),
        SearchOptions.searchOptions()
          .sort("type", SearchSort.byField("description"))
      );
      

      Set a breakpoint in ClassicCoreSearchOps.injectOptions where the sort array is generated.

      expected value for the sort field:

      ["type",{"by":"field","desc":false,"field":"name"}]
      

      actual value:

      [{"by":"field","desc":false,"field":"name"},"type"]
      

      Note that the sort tiers specified as strings are always appended to the end of the list, instead of appearing in the order they were added to the sort.

      Attachments

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

        Activity

          People

            david.nault David Nault
            david.nault David Nault
            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