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

Issue with merging FacetResults when the first operand contain a FacetResults with nil Terms

    XMLWordPrintable

Details

    • Untriaged
    • 0
    • Unknown

    Description

      Criminal: func (fr *FacetResult) Merge(other *FacetResult){}

      Merge method isn't handling the case when fr.Terms == nil. 

       

      ----------------------------------------------------

      Q) But how did fr.Terms became nil ?? ( It is a struct and as per the usual code flow it is unlikely to have nil value )

      Ans)

      FacetResult construct implements custom json marshal and unmarshal logic 
      ( This was introduced in https://github.com/blevesearch/bleve/pull/1404 )

      func (tf *TermFacets) MarshalJSON() ([]byte, error) {
          return util.MarshalJSON(tf.termFacets)
      }

      In case when tf.termFacets is nil, tf will be marshalled as "null" in json object, Thus making fr.Terms nil.

       

       

      Attachments

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

        Activity

          People

            mohd.shaadkhan Shaad Khan
            mohd.shaadkhan Shaad Khan
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty