Uploaded image for project: 'C++ Couchbase Client'
  1. C++ Couchbase Client
  2. CXXCBC-481

Fix crash parsing search result hits

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.0.0-dp.14
    • 1.0.0-dp.13
    • None
    • None
    • 0

    Description

      With the latest server version there have been a couple of instances where the C++ SDK will crash when parsing the hits w/in the search response. We should move the .at() -> .optional() and also try/catch the parsing so that we at least return an error instead of crashing.

      Examples have been:

      • With 7.6 if you disable scoring, the score is not returned in the hit (it was returned in previous versions)
      • At one point 7.6 was returning not returning the index field and instead returning index_names. This was a bug that was fixed, but still, the C++ SDK should not crash when parsing.

      Example search request:

      {"ctl":{"timeout":75000},"explain":false,"query":{"term":"auto"},"score":"none","size":10}
      

      Example 7.2.5 response (just showing a hit):

      {
          "id": "e35ac43a::13",
          "index": "test-search-index_15a633800e3a4641_4c1c5584",
          "score": 0.19669274441134066,
          "sort":
          [
              "_score"
          ]
      },
      

      Example 7.6.0-2169 response (just showing a hit):

      {
          "id": "22f3df03::13",
          "index": "test-search-index_298b1592a35c2c64_4c1c5584",
          "sort":
          [
              "_score"
          ]
      },
      

      Attachments

        Issue Links

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

          Activity

            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