: That sounds quite reasonable indeed. But i don't understand why Solr doesn't 
: throw an exception when i actually index a string in a long fieldType while i 
: do remember getting some number formatting exception when pushing strings to 
: an integer fieldType.
: 
: With the current set up i can send a properly formatted date to a long 
: fieldType, which should, in my opionion, punish me with an exception.

I must have missunderstood your initial email -- i thought you said you 
built the index externally (using nutch) and were only *reading* it with 
solr.

when indexing, the same rules apply: field types only attempt to parse the 
data coming in if they need to, and they skip it for perfornace when they 
done.

Field types like solr.TrieIntField and solr.TrieLongField will complain if 
you feed them an arbitrary string, because thye parse their input int an 
acutal Numeric object for special binary encoding.

If you use the legacy solr.IntField or solr.LongField (which don't support 
ranges and don't do any special encoding) these don't parse the input at 
all -- they just index the raw string....

    <!--
      Note:
      These should only be used for compatibility with existing indexes 
(created with lucene or older Solr versions).

      Plain numeric field types that store and index the text
      value verbatim (and hence don't correctly support range queries, since the
      lexicographic ordering isn't equal to the numeric ordering)
    -->
    <fieldType name="pint" class="solr.IntField" omitNorms="true"/>
    <fieldType name="plong" class="solr.LongField" omitNorms="true"/>
    <fieldType name="pfloat" class="solr.FloatField" omitNorms="true"/>
    <fieldType name="pdouble" class="solr.DoubleField" omitNorms="true"/>
    <fieldType name="pdate" class="solr.DateField" sortMissingLast="true" 
omitNorms="true"/>



-Hoss

Reply via email to