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

Negative single-valued float field values are not included in facet range counts when the field has docvalues and facet.range.method=dv

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • None
    • 7.0
    • None
    • None

    Description

      Found while increasing TestPointsField randomization on SOLR-10796:

      When a non-multiValued float field, either Trie- or points-based, has docvalues and a facet.range request uses facet.range.method=dv, negative values are not included in the facet range counts.

      This test added to SimpleFacetsTest succeeds for the request with facet.range.method=filter, but fails for the same request with facet.range.method=dv (failure is on line 17 in the listing below) - see the schema excerpt below for field/type:

       1:  public void testDvMethodNegativeFloatRangeFacet() throws Exception {
       2:    String field = "negative_num_f1_dv";
       3:    assertTrue(h.getCore().getLatestSchema().getField(field).hasDocValues());
       4:
       5:    final String[] commonParams = { 
       6:        "q", "*:*", "facet", "true", "facet.range.start", "-2", "facet.range.end", "0", "facet.range.gap", "2"
       7:    };
       8:    final String countAssertion
       9:        = "//lst[@name='facet_counts']/lst[@name='facet_ranges']/lst[@name='%s']/lst[@name='counts']/int[@name='-2.0'][.='1']";
      10:
      11:    assertU(adoc("id", "10001", field, "-1.0"));
      12:    assertU(commit());
      13:
      14:    assertQ(req(commonParams, "facet.range", field, "facet.range.method", "filter"),
      15:        String.format(countAssertion, field)
      16:    );
      17:    assertQ(req(commonParams, "facet.range", field, "facet.range.method", "dv"),
      18:        String.format(countAssertion, field)
      19:    );
      20:  }
      

      From schema.xml:

        <fieldType name="float" class="${solr.tests.FloatFieldType}" docValues="${solr.tests.numeric.dv}" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
        <dynamicField name="*_f1_dv" type="float" indexed="true" stored="true" docValues="true" multiValued="false"/>
      

      Attachments

        1. SOLR-11043.patch
          8 kB
          Tomas Eduardo Fernandez Lobbe
        2. SOLR-11043.patch
          23 kB
          Tomas Eduardo Fernandez Lobbe
        3. SOLR-11043.patch
          9 kB
          Tomas Eduardo Fernandez Lobbe

        Issue Links

          Activity

            There is a bug in IntervalFacets (which range facets “dv” mode uses) for negative float values. Attaching patch with the fix. This needs more tests, but it passes the two Steve added.

            tflobbe Tomas Eduardo Fernandez Lobbe added a comment - There is a bug in IntervalFacets (which range facets “dv” mode uses) for negative float values. Attaching patch with the fix. This needs more tests, but it passes the two Steve added.
            sarowe Steven Rowe added a comment -

            Cool, thanks Tomás!

            TestPointFields, SimpleFacetsTest and TestIntervalFaceting each passed a couple times for me with your patch.

            sarowe Steven Rowe added a comment - Cool, thanks Tomás! TestPointFields, SimpleFacetsTest and TestIntervalFaceting each passed a couple times for me with your patch.

            Here is a patch with some more tests. The random test fails for some seeds with point fields. I suspect it may be a bug with point fields. Will look into that

            tflobbe Tomas Eduardo Fernandez Lobbe added a comment - Here is a patch with some more tests. The random test fails for some seeds with point fields. I suspect it may be a bug with point fields. Will look into that

            Patch with fix and tests for this Jira issue in particular. Will commit this and create a new Jira for the improvements in the random test of interval facets (since that one can be blocked by SOLR-11070 and SOLR-11057)

            tflobbe Tomas Eduardo Fernandez Lobbe added a comment - Patch with fix and tests for this Jira issue in particular. Will commit this and create a new Jira for the improvements in the random test of interval facets (since that one can be blocked by SOLR-11070 and SOLR-11057 )

            Commit 9e4aaf97809582d2232276d190a4e18197a79923 in lucene-solr's branch refs/heads/master from tflobbe
            [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9e4aaf9 ]

            SOLR-11043: Fix facet.range.method=dv and interval facets on single-valued float fields with negative values

            jira-bot ASF subversion and git services added a comment - - edited Commit 9e4aaf97809582d2232276d190a4e18197a79923 in lucene-solr's branch refs/heads/master from tflobbe [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9e4aaf9 ] SOLR-11043 : Fix facet.range.method=dv and interval facets on single-valued float fields with negative values

            Commit 5bcf9403c06112b72474ae545c52aa3a36307a54 in lucene-solr's branch refs/heads/master from tflobbe
            [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=5bcf940 ]

            SOLR-11043: Precommit fix and trivial change to test

            jira-bot ASF subversion and git services added a comment - - edited Commit 5bcf9403c06112b72474ae545c52aa3a36307a54 in lucene-solr's branch refs/heads/master from tflobbe [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=5bcf940 ] SOLR-11043 : Precommit fix and trivial change to test

            Commit 6095d1199dbe89eefe18d96dbf98686369496203 in lucene-solr's branch refs/heads/branch_7x from tflobbe
            [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6095d11 ]

            SOLR-11043: Fix facet.range.method=dv and interval facets on single-valued float fields with negative values

            jira-bot ASF subversion and git services added a comment - - edited Commit 6095d1199dbe89eefe18d96dbf98686369496203 in lucene-solr's branch refs/heads/branch_7x from tflobbe [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6095d11 ] SOLR-11043 : Fix facet.range.method=dv and interval facets on single-valued float fields with negative values

            Commit 3abdff12cc05d04a8c8ab6676a39a4f2bb593654 in lucene-solr's branch refs/heads/branch_7x from tflobbe
            [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=3abdff1 ]

            SOLR-11043: Precommit fix and trivial change to test

            jira-bot ASF subversion and git services added a comment - - edited Commit 3abdff12cc05d04a8c8ab6676a39a4f2bb593654 in lucene-solr's branch refs/heads/branch_7x from tflobbe [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=3abdff1 ] SOLR-11043 : Precommit fix and trivial change to test

            Commit a1db93badc36ede54ab807b12792c7c999bbb59e in lucene-solr's branch refs/heads/branch_7_0 from tflobbe
            [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a1db93b ]

            SOLR-11043: Fix facet.range.method=dv and interval facets on single-valued float fields with negative values

            jira-bot ASF subversion and git services added a comment - - edited Commit a1db93badc36ede54ab807b12792c7c999bbb59e in lucene-solr's branch refs/heads/branch_7_0 from tflobbe [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a1db93b ] SOLR-11043 : Fix facet.range.method=dv and interval facets on single-valued float fields with negative values

            Commit 334d75c6fd2d5f78d1235fc55a84a5b7da48ebe5 in lucene-solr's branch refs/heads/branch_7_0 from tflobbe
            [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=334d75c ]

            SOLR-11043: Precommit fix and trivial change to test

            jira-bot ASF subversion and git services added a comment - - edited Commit 334d75c6fd2d5f78d1235fc55a84a5b7da48ebe5 in lucene-solr's branch refs/heads/branch_7_0 from tflobbe [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=334d75c ] SOLR-11043 : Precommit fix and trivial change to test

            Commit baa866970b7e794dd6746868bd4db54e97d06d3b in lucene-solr's branch refs/heads/master from tflobbe
            [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=baa8669 ]

            SOLR-11043: Fix SimpleFacets

            jira-bot ASF subversion and git services added a comment - - edited Commit baa866970b7e794dd6746868bd4db54e97d06d3b in lucene-solr's branch refs/heads/master from tflobbe [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=baa8669 ] SOLR-11043 : Fix SimpleFacets

            Commit 296808069fb8d1daeef55720284f43f94e636c73 in lucene-solr's branch refs/heads/branch_7x from tflobbe
            [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2968080 ]

            SOLR-11043: Fix SimpleFacets

            jira-bot ASF subversion and git services added a comment - - edited Commit 296808069fb8d1daeef55720284f43f94e636c73 in lucene-solr's branch refs/heads/branch_7x from tflobbe [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2968080 ] SOLR-11043 : Fix SimpleFacets

            Commit 0c17e02a82b9c552b775da22cbd78b511ec0de22 in lucene-solr's branch refs/heads/branch_7_0 from tflobbe
            [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=0c17e02 ]

            SOLR-11043: Fix SimpleFacets

            jira-bot ASF subversion and git services added a comment - - edited Commit 0c17e02a82b9c552b775da22cbd78b511ec0de22 in lucene-solr's branch refs/heads/branch_7_0 from tflobbe [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=0c17e02 ] SOLR-11043 : Fix SimpleFacets

            People

              tflobbe Tomas Eduardo Fernandez Lobbe
              sarowe Steven Rowe
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: