lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomás Fernández Löbbe (JIRA) <j...@apache.org>
Subject [jira] [Updated] (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
Date Tue, 11 Jul 2017 04:02:00 GMT

     [ https://issues.apache.org/jira/browse/SOLR-11043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tomás Fernández Löbbe updated SOLR-11043:
-----------------------------------------
    Attachment: SOLR-11043.patch

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.

> Negative single-valued float field values are not included in facet range counts when
the field has docvalues and facet.range.method=dv
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-11043
>                 URL: https://issues.apache.org/jira/browse/SOLR-11043
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Steve Rowe
>         Attachments: SOLR-11043.patch
>
>
> 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:
> {code:java}
>  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:  }
> {code}
> From {{schema.xml}}:
> {code: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"/>
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message