[Xapian-tickets] [Xapian] #697: Omega SORTREVERSE semantics confusing

Xapian nobody at xapian.org
Tue Feb 2 11:46:50 GMT 2016


#697: Omega SORTREVERSE semantics confusing
--------------------+-----------------------------
 Reporter:  olly    |             Owner:  olly
     Type:  defect  |            Status:  assigned
 Priority:  normal  |         Milestone:  1.3.5
Component:  Omega   |           Version:  1.3.3
 Severity:  normal  |        Resolution:
 Keywords:          |        Blocked By:
 Blocking:          |  Operating System:  All
--------------------+-----------------------------

Comment (by olly):

 Hmm, though the "easy to upgrade" argument is rather reduced if you have
 to specify `SORTREV` if you specify `SORT` (which wasn't the case for
 `SORTREVERSE` of course).

 So a single parameter specifying both the sort key and direction would be
 a simpler upgrade if you never reverse the order (since you still just
 specify one parameter, it's just a different one with a different value
 for each sort).

 I don't think we can just add the option to prefix `SORT` with `-` though
 - currently `SORT=1` means "reverse sort on value slot 1", so `SORT=-1`
 would then be "forward sort on value slot 1"!  We'd need a prefix or
 suffix for both directions, at least for the transition, so something like
 `SORT=+1` vs `SORT=-1` (the latter being the same as `SORT=1` currently
 is).

 With that, we could actually keep `SORTREVERSE` to mean "reverse the sort
 order specified by `SORT`", so `SORT=+1 SORTREVERSE=1` would be the same
 as `SORT=-1` or `SORT=-1 SORTREVERSE=0`.

 With that, the simplest upgrade path is actually just to prefix your
 `SORT` parameter values with `-`, making explicit the currently implicit
 default of "reversed".

 Overall, I'm liking this.  Even the `-` prefixed slot numbers seems less
 odd when there's also `+`.

--
Ticket URL: <https://trac.xapian.org/ticket/697#comment:9>
Xapian <//xapian.org/>
Xapian



More information about the Xapian-tickets mailing list