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

Search with N1QL doesn't push down scope into the query: sometimes

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Unknown

    Description

      The two queries should be identical

      Note, I am testing with an FTS index on `travel-sample`.inventory.landmark with a dynamic type mapping on inventory.landmark.

      this is correct

      SELECT /* h.content, */ h.id AS _id, SEARCH_SCORE() AS _score
      FROM `travel-sample`.inventory.landmark AS h
      WHERE SEARCH(h.content, "+paris +notre +dame")
      _id _score
      25933 2.7195699184273776
      21782 1.6599383892495942
      21603 2.5323457161345346
      

      this is incorrect

      SELECT /* h.content, */ h.id AS _id, SEARCH_SCORE() AS _score
      FROM `travel-sample`.inventory.landmark AS h
      WHERE SEARCH(h.content, {"query": "+paris +notre +dame"})
      ORDER BY _score DESC
      _id _score
      21603 1.7580958760961103
      21752 1.6636198923208063
      21867 1.5309311435541715
      21864 1.2123922761691992
      21782 1.0390219329977914
      25933 1.0103269228837675
      21688 0.8761105647604155
      21788 0.706441693239785
      

      both should operate like the following curl payload
      {
      "explain": false,
      "fields": [
      "*"
      ],
      "highlight": {},
      "query": {
      "query": "+content:paris +content:notre +content:dame"
      },
      "size": 10,
      "from": 0,
      "sort": [
      "-_score"
      ]
      }

      Attachments

        For Gerrit Dashboard: MB-51434
        # Subject Branch Project Status CR V

        Activity

          People

            girish.benakappa Girish Benakappa
            jon.strabala Jon Strabala
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty