: I've a "long" field defined in my schema:
: 
: <fieldType name="long" class="solr.TrieLongField" precisionStep="0"
: omitNorms="true" positionIncrementGap="0" />
: 
: <field name="ts" type="long" indexed="true" stored="true" required="true" />
: 
: Before r1201855 I could use "stats.facet=ts" which allowed me to have a
: timeseries of sorts, now I get an error:

Since your field type doesn't explicitly state "multiValued="true|false" 
Solr's behavior in parsing the schema.xml is driven by the "version" param 
on the <schema/> tag.  From the example in Solr 3.5...

<schema name="example" version="1.4">
  <!-- attribute "name" is the name of this schema and is only used for display 
purposes.
       Applications should change this to reflect the nature of the search 
collection.
       version="1.4" is Solr's version number for the schema syntax and 
semantics.  It should
       not normally be changed by applications.
       1.0: multiValued attribute did not exist, all fields are multiValued by 
nature
       1.1: multiValued attribute introduced, false by default 
       1.2: omitTermFreqAndPositions attribute introduced, true by default 
except for text fields.
       1.3: removed optional field compress feature
       1.4: default auto-phrase (QueryParser feature) to off
     -->

...so if you don't have a version param, or your version param is "1.0" 
then that would explain this error: you've told Solr that this field is 
multivalued (even though you may not be using it that way) and Solr can 
not reasonably compute stats on a multivalued field (the fact that it may 
have done so prior to r1201855 was most likely a failure to error check) 
-- adding multiValued="false" to your "<field/> should make this work.

(If that doens't fix the problem for you, then i'm genuinely baffled, and 
please file a Jira bug with as much details as possible about your setup 
(ideally a fully usable solrconfig.xml+schema.xml that demonstrates your 
problem) because the StatsComponentTest most certainly already tests that 
stats can be computed on a multiValued="false" TrieLongField with 
precisionsStep="0")

-Hoss

Reply via email to