: valType is NOT optional at all, at least in the 3x code line.
: You get errors like this on startup if you leave it out:
: 
: Dec 14, 2011 2:07:48 PM org.apache.solr.common.SolrException log
: SEVERE: org.apache.solr.common.SolrException: Missing parameter
: 'valType' for FieldType=eff_float{keyField=id, defVal=1}
:       at org.apache.solr.schema.FieldType.getArg(FieldType.java:121)

ah, interesting .. it looks like it was intended to be optional, but 
"getArg" fails if it's not specified (note that ExternalFileField 
explicitly checks if valType is not null, but doesn't error if it is.

: So I think I now propose to remove that check altogether. The code should
: still work whether the valType is specified or not  and make note that it
: ignored for now. This is really no change in behavior, just documenting what
: happens currently.
: 
: I'm assuming that we should still work with schemas that define it rather
: than break someone's schema if it is there by, for instance, using a 3.5
: schema file with valType in an EFF field with new code and the proposed
: change.

exactly.  I would just change that valType parsing to stop using the 
getArg method (and pull it from the params directly) and add a comment 
about this conversation and the hypothetical use for valType in the 
future.

I guess the main take away is that if someone specifies valType and it 
does *not* point to a FloatField, we should still probably error (don't 
want them assuming they can use ints or doubles or longs or dates or 
strings etc...) but in all our examples / docs we should just stop 
bothering to advertise valType.



-Hoss

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

Reply via email to