|
Either LongField and DoubleField should log a warning that they not suitable for sorting (and this should be added to the javadocs) and that they defer to int/float based sorting which may have casting/parsing issues ... in which case people using small enough values will be fine. ...OR... LongField and DoubleField should throw big exceptions if you try to use them to sort saying that if you wnat to Sort, use SortableLongField/SortableDoubleField (the names seem pretty intuitive to me) It also can't perform FunctionQuery's on longs and doubles either
Adding the functionality to the FieldCache should allow us to then implement the appropriate pieces in Solr: LongFieldSource, etc.
Requires
Patch based on latest trunk of Lucene, where I committed the changes to create ExtendedFieldCache and added support for sorting by long and doubles.
Also needs the latest Lucene jars. There may be some changes to FieldCache based on this, which could remove the ExtendedFieldCache interface.
Update of this for the latest changes in Lucene (see
Adds in support for Short and byte as well, but I did not add the declaration of those field types to the schema.xml examples. Requires the latest trunk of Lucene (not even last nights build) Grant, should this issue be closed? See
No, Solr needs to be able to leverage what is in
Ah, this is in Solr-land, sorry, thought it was Lucene.
Here's an update to this patch. I dropped short/byte support for now because I somehow forgot to add in SortField.BYTE and SortField.SHORT on the related Lucene patch. I will open a separate issue for those.
Applying this patch should resolve the long/double issue. Committed revision 629334.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
As a workaround for now, the type "slong" (sortable long), is able to do both range queries and sorts.