> I have an issue with range queries on a long value in our > dataset (the dataset is fairly large, but i believe the > problem still exists for smaller datasets). When i > query the index with a range, as such: id:[1 TO 2000], I get > values back that are well outside that range. Its as > if the range query is ignoring the values and doing > something like id:[* TO *]. We are running Solr 1.3. > The value is set as the unique key for the index. > > Our schema is similar to this: > > <field name="id" type="long" indexed="true" > stored="true" required="true" /> > <field name="field_1" type="slong" indexed="true" > stored="false" required="true" /> > <field name="field_2" type="long" indexed="true" > stored="false" required="false" /> > <field name="field_3" type="long" indexed="true" > stored="false" required="false" />
You need to use sortable double in solr 1.3.0 type="slong" for range queries to work correctly. Default schema.xml has an explanation about sortable (sint etc) types.