Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-6375

facet_ranges count for before,after,between differ if #shards>1

    XMLWordPrintableJSON

    Details

      Description

      I am currently running the test https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/test/org/apache/solr/request/SimpleFacetsTest.java#L859 on multi shard environment and i notice some discrepancies with facet_range count for after,before, and between tags if the # of shards !=1

      Running the query(https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/test/org/apache/solr/request/SimpleFacetsTest.java#L874) on #shards = 1 and matches the expected output

      <?xml version="1.0" encoding="UTF-8"?>
      <response>
      <lst name="responseHeader">
        <int name="status">0</int>
        <int name="QTime">12</int>
        <lst name="params">
          <str name="facet.range.include">lower</str>
          <str name="facet.range.other">all</str>
          <str name="facet">true</str>
          <str name="indent">true</str>
          <str name="q">*:*</str>
          <str name="facet.range.start">1976-07-01T00:00:00.000Z</str>
          <str name="facet.range">a_tdt</str>
          <str name="facet.range.end">1976-07-16T00:00:00.000Z</str>
          <str name="facet.range.gap">+1DAY</str>
          <str name="wt">xml</str>
          <str name="rows">0</str>
        </lst>
      </lst>
      <result name="response" numFound="63" start="0">
      </result>
      <lst name="facet_counts">
        <lst name="facet_queries"/>
        <lst name="facet_fields"/>
        <lst name="facet_dates"/>
        <lst name="facet_ranges">
          <lst name="a_tdt">
            <lst name="counts">
              <int name="1976-07-01T00:00:00Z">1</int>
              <int name="1976-07-02T00:00:00Z">0</int>
              <int name="1976-07-03T00:00:00Z">0</int>
              <int name="1976-07-04T00:00:00Z">1</int>
              <int name="1976-07-05T00:00:00Z">2</int>
              <int name="1976-07-06T00:00:00Z">0</int>
              <int name="1976-07-07T00:00:00Z">1</int>
              <int name="1976-07-08T00:00:00Z">0</int>
              <int name="1976-07-09T00:00:00Z">0</int>
              <int name="1976-07-10T00:00:00Z">0</int>
              <int name="1976-07-11T00:00:00Z">0</int>
              <int name="1976-07-12T00:00:00Z">0</int>
              <int name="1976-07-13T00:00:00Z">2</int>
              <int name="1976-07-14T00:00:00Z">0</int>
              <int name="1976-07-15T00:00:00Z">1</int>
            </lst>
            <str name="gap">+1DAY</str>
            <date name="start">1976-07-01T00:00:00Z</date>
            <date name="end">1976-07-16T00:00:00Z</date>
            <int name="before">1</int>
            <int name="after">1</int>
            <int name="between">8</int>
          </lst>
        </lst>
      </lst>
      </response>
      

      Running the same above on #shards > 1 (facet_range count for after,before,between differs)

      <response>
      <lst name="responseHeader">
        <int name="status">0</int>
        <int name="QTime">7</int>
        <lst name="params">
          <str name="facet.range.include">lower</str>
          <str name="facet.range.other">all</str>
          <str name="facet">true</str>
          <str name="indent">true</str>
          <str name="q">*:*</str>
          <str name="facet.range.start">1976-07-01T00:00:00.000Z</str>
          <str name="facet.range">a_tdt</str>
          <str name="facet.range.end">1976-07-16T00:00:00.000Z</str>
          <str name="facet.range.gap">+1DAY</str>
          <str name="wt">xml</str>
          <str name="rows">0</str>
        </lst>
      </lst>
      <result name="response" numFound="63" start="0" maxScore="1.0">
      </result>
      <lst name="facet_counts">
        <lst name="facet_queries"/>
        <lst name="facet_fields"/>
        <lst name="facet_dates"/>
        <lst name="facet_ranges">
          <lst name="a_tdt">
            <lst name="counts">
              <int name="1976-07-01T00:00:00Z">1</int>
              <int name="1976-07-02T00:00:00Z">0</int>
              <int name="1976-07-03T00:00:00Z">0</int>
              <int name="1976-07-04T00:00:00Z">1</int>
              <int name="1976-07-05T00:00:00Z">2</int>
              <int name="1976-07-06T00:00:00Z">0</int>
              <int name="1976-07-07T00:00:00Z">1</int>
              <int name="1976-07-08T00:00:00Z">0</int>
              <int name="1976-07-09T00:00:00Z">0</int>
              <int name="1976-07-10T00:00:00Z">0</int>
              <int name="1976-07-11T00:00:00Z">0</int>
              <int name="1976-07-12T00:00:00Z">0</int>
              <int name="1976-07-13T00:00:00Z">2</int>
              <int name="1976-07-14T00:00:00Z">0</int>
              <int name="1976-07-15T00:00:00Z">1</int>
            </lst>
            <str name="gap">+1DAY</str>
            <date name="start">1976-07-01T00:00:00Z</date>
            <date name="end">1976-07-16T00:00:00Z</date>
            <int name="before">1</int>
            <int name="after">0</int>
            <int name="between">3</int>
          </lst>
        </lst>
      </lst>
      </response>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tomasflobbe Tomás Fernández Löbbe
                Reporter:
                vamsee Vamsee Yarlagadda
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: