#431: WebSearch: fix test case searching by date 1976-04-01 and t dog
------------------------+----------------------
  Reporter:  simko      |      Owner:  valkyrie
      Type:  defect     |     Status:  assigned
  Priority:  major      |  Milestone:  v1.0
 Component:  WebSearch  |    Version:
Resolution:             |   Keywords:
------------------------+----------------------
Changes (by jblayloc):

 * owner:  jblayloc => valkyrie
 * status:  new => assigned


Comment:

 This should definitely get moved to the dateutil-only testing section.

 The strange behavior is intentional, and is the result of two different
 things.  First, dateutil always attaches a day to dates.  You can't have
 it parse a month alone and, by default, when no day is given, it assigns
 01.  So we can't know for sure whether the user actually meant the first
 day of the month or the whole month.  And SPIRES syntax typically allows
 people to leave the day unspecified, so there's a minor disconnect there.

 Second, the year: index (and possibly others) contain entries like 1994-04
 which should perfectly well come up when searching for the whole of April,
 1994, but not otherwise.  Because dates are sorted lexicographically, the
 only way to be sure you get *every* date in April is to ask for date >
 1994-04 rather than, say, > 1994-04-01.  Also, without a day attached to
 index entries, we can't know which date they're for, so there's some
 intrinsic ambiguity there.

 The combination of these two behaviours made me think that I should err on
 the side of returning too much rather than too little.  Particularly as
 the most common use of these date manipulations appears to be as a stand-
 in for RSS-like things; the problem of having a little extra material
 seems smaller than the problem of missing some things.

-- 
Ticket URL: <http://invenio-software.org/ticket/431#comment:1>
Invenio <http://invenio-software.org>

Reply via email to