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

fts may not always return 'score' in 7.6.0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • None
    • FullText
    • None
    • 0

    Description

      fts may not always return 'score' in 7.6.0

      MB-60719

      138:

          JsonNode scoreObj =  hit.get("score");
          double score = scoreObj != null ? scoreObj.doubleValue() : 0;
      

      186:

          // Use original score node to preserve exact representation.
          JsonNode scoreNode = hit.path("score");
          String scoreText = scoreNode != null ? "0" : scoreNode.asText();  // <------------------------
       
          return () -> {
            List<String> keys = new ArrayList<>(keysetNode.size());
            keysetNode.forEach(it -> keys.add(it.asText())); // faster than Mapper.convert
       
            // replace "_score" with actual score
            for (ListIterator<String> i = keys.listIterator(); i.hasNext(); ) {
              if ("_score".equals(i.next())) {
                i.set(scoreText);  // <--------------------------------
                break;
              }
            }
       
            return new CoreSearchKeyset(keys);
          };
      

      Attachments

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

        Activity

          People

            michael.reiche Michael Reiche
            michael.reiche Michael Reiche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty