lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 26702] - [PATCH] arbitrary sorting
Date Fri, 13 Feb 2004 21:06:20 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26702>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26702

[PATCH] arbitrary sorting





------- Additional Comments From cutting@apache.org  2004-02-13 21:06 -------
I prefer an ascending/descending flag.  It's more concise than _REVERSE types
and more consistent than a reverse flag (with different types having different
natural orderings).  Also, sometimes folks could want ascending document numbers
or even scores: it really is universally applicable.

We can always make things simpler by adding utility methods to Sort, like:
  public void addIncreasingDocument();
  public void addDecreasingInt(String field);
and/or by adding static "constructor" methods to SortField, like:
  public static SortField increasing(String field);  // uses AUTO
  public static SortField increasingFloat(String field);
These might make application code more easily readable.

Another feature (that might be added later) is date sorting.  If a field's
values are parseable by DateFormat then it should be possible to sort results by
them.  Internally these could be represented as longs, once parsed.  The AUTO
field type could first try to parse with DateFormat too.  What do you think?

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message