Are you using Solr 1.4.1? Are you using the example default schema
from Solr 1.4.1? "int", which I recommended, is not the same as
"integer", which you report. In Solr 1.4.1.
Different field types have a somewhat confusing history in Solr. With
Solr 1.4, there are new types based on the Trie class which pretty much
Just Work. Some of the old legacy types that is not true of. What
makes it more confusing is that you _can_ call your field types whatever
you want in your schema.xml, you don't need to use the same names as
everyone else.
You want a Solr 1.4(.1) "int" type, defined like so:
<fieldType name="int" class="solr.TrieIntField" precisionStep="0"
omitNorms="true" positionIncrementGap="0"/>
One could theoretically change the name to whatever one wanted in their
schema.xml, but you want to be using a field that's defined as a
class="solr.TrieIntField".
If you are using something earlier than Solr 1.4, someone else will have
to tell you the proper field to use that will give you a sortable int.
The field type in a standard schema.xml that's defined as "integer" is
NOT sortable. You can not sort on this and get what you want. (What's
the point of it even existing then, if it pretty much does the same
thing as a string field? I have no idea, I can't tell you, and I don't
worry about it. I just use the new fields that work in 1.4)
<fieldType name="integer" class="solr.IntField" omitNorms="true"/>
PeterKerk wrote:
This is the field in my schema.xml:
<field name="location_rating_total" type="integer" indexed="true"
stored="true"/>
Also in the response it clearly shows:
<int name="location_rating_total">0</int>
What else can I do?