Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-1144

Align search API sort option with RFC

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.2.1
    • None
    • None
    • 1

    Description

      Currently, in order to use the sort option with the search API, fields to sort by must be passed in with a List[str]. The provided classes (SortString(), SortScore(), SortID() and SortField()) that inherit the Sort() class will not encode the fields into proper JSON to pass in the search request. The Sort() class and subclasses should be corrected in order to align with the RFC.

      Works:

      result = cluster.search_query(
          "travel-sample-index", search.TermQuery("downtown"), SearchOptions(sort=["-_score", "description"]))
      

      Once updated, add another example to docs to show users how to use the provided Sort() subclasses with the sort option in the search API.

      Attachments

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

        Activity

          There are no comments yet on this issue.

          People

            jared.casey Jared Casey
            jared.casey Jared Casey
            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