lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gunnlaugur Thor Briem (Commented) (JIRA)" <>
Subject [jira] [Commented] (SOLR-1023) StatsComponent should support dates (and other non-numeric fields)
Date Tue, 15 Nov 2011 08:19:51 GMT


Gunnlaugur Thor Briem commented on SOLR-1023:

No, pretty similar.

In my two patches the only difference was that the trunk version used {{BytesRef}}s where
the branch_3x one used {{String}}s.

Here are the changes Ryan made from my trunk patch:

(a) started passing around {{SchemaField}}s rather than {{FieldType}}s, I think specifically
in order to call {{ft.toObject(sf, value)}} in {{StatsValuesFactory}}. But that {{toObject}}
method isn't available in {{branch_3x}} as he pointed out, so the whole {{FieldType}}-to-{{SchemaField}}
change is probably not needed there. Much of the diff stems from this.

(b) generalized {{class DoubleStatsValues extends AbstractStatsValues<Double>}} to {{class
NumericStatsValues extends AbstractStatsValues<Number>}}

(c) made {{DateStatsValues}} extend {{AbstractStatsValues<Date>}} instead of {{AbstractStatsValues<String>}}
(as it should), with the simplifications that allowed.

(d) fixed some indentation bloopers from me.

I've updated my branch_3x SVN patch with changes (b), (c) and (d), attaching.
> StatsComponent should support dates (and other non-numeric fields)
> ------------------------------------------------------------------
>                 Key: SOLR-1023
>                 URL:
>             Project: Solr
>          Issue Type: New Feature
>    Affects Versions: 1.4
>         Environment: Mac OS 10.5, java version "1.5.0_16"
>            Reporter: Peter Wolanin
>            Assignee: Ryan McKinley
>             Fix For: 3.5, 4.0
>         Attachments: SOLR-1023-against-branch_3x.svn.patch, SOLR-1023-against-lucene_3_4_0.patch,
SOLR-1023.patch, SOLR-1023.patch, SOLR-1023.patch, SOLR-1023.patch, stats-component-path-nightly-2009-10-08.patch
> Currently, the StatsComponent only supports single-value numeric fields:
> trying to use it with a date field I get an exception like:  java.lang.NumberFormatException:
For input string: "2009-01-27T20:04:04Z"
> trying to use it with a string I get an error 400  "Stats are valid for single valued
numeric values."
> For constructing date facets it would be very useful to be able to get the minimum and
maximum date from a DateField within a set of documents.  In general, it could be useful to
get the minimum and maximum from any field type that can be compared, though that's of less

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message