On Sat, Jan 12, 2013 at 4:56 PM, jefferyyuan <yuanyun...@gmail.com> wrote:
> Looked at Lucene Javadoc, seems we can run range query, filter, sorting on
> IntField.
> Also seems IntField is also indexed as trie structure.
> Javadoc for IntField:

You're reading the javadoc for *lucene* IntField.
Unfortunately, Lucene has duplicated many of the field names as Solr,
which leads to confusion like this.

> So what is the difference between IntField and TrieIntField, which one we
> should use, and how to choose it?

For "int" vs "tint", see the comment in schema.xml (the only diff is
what precisionStep is used):

    <!--
     Numeric field types that index each value at various levels of precision
     to accelerate range queries when the number of values between the range
     endpoints is large. See the javadoc for NumericRangeQuery for internal
     implementation details.

     Smaller precisionStep values (specified in bits) will lead to more tokens
     indexed per value, slightly larger index size, and faster range queries.
     A precisionStep of 0 disables indexing at different precision levels.
    -->
    <fieldType name="tint" class="solr.TrieIntField" precisionStep="8"
positionIncrementGap="0"/>
   [...]

And for the "pint" which uses *Solr's* IntField, this is the relevant
comment in solr.xml:

    <!--
      Note:
      These should only be used for compatibility with existing indexes (created
 with lucene or older Solr versions).
      Use Trie based fields instead. As of Solr 3.5 and 4.x, Trie based fields s
upport sortMissingFirst/Last

      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"/>
   [...]


-Yonik
http://lucidworks.com

Reply via email to