Thanks. Is there any performance penalty vs. LongField? I don't need to do any 
range queries on these value. I am basically treating them as numerical 
strings. I thought it would just be a shortcut to strip leading zeros, which I 
can easily do on my own.




________________________________
From: Chris Hostetter <hossman_luc...@fucit.org>
To: Solr <solr-user@lucene.apache.org>
Sent: Tue, January 12, 2010 3:16:13 PM
Subject: Re: LongField not stripping leading zeros

: I have some text in our database in the form 0088698183939. The leading 
: zeros are useless, but I want to able to search it with no leading zeros 
: or several leading zeros. So, I decided to index this as a long, 
: expecting it to just store it as a number. But, instead, I see this in 
: the index:

Note the comment s about LongField in the example schema...

      Plain numeric field types that store and index the text
      value verbatim (and hence don't support range queries, since the
      lexicographic ordering isn't equal to the numeric ordering)

...LongField, IntField, etc.. all just index/store the exact value you 
put in -- the only distinctions between them and StrField is that they are 
rendered back as a numeric type (by the response writers) and they use the 
numericly typed FieldCache for sorting.

You should be using TrieLongField (or SortableLongField if you need 
sortMissing* type functionality)


-Hoss


      

Reply via email to