[GeoNetwork-devel] Date search issues

Hi

In LuceneSearcher we have this processing of the date query fields:

processTimeRange(request.getChild(SearchParameter.DATEFROM), “0000-01-01”, request.getChild(SearchParameter.DATETO), “9999-01-01”);

This is causing some bizarre behaviour in date searches as the date query values are converted to UTC, so when querying from UI:

  1. dateFrom:
    2015-02-10
  2. dateTo:
    2015-02-11

is converted to this Lucene query (removing in my case 1 hour and adding the Z):

+changeDate:[2015-02-10T23:00:00.000Z TO 2015-02-10T23:00:00.000Z]

but the index contains this (no zone info there): 2015-02-11T12:35:39

Does make sense the processing of the time range?

Another issue related to the date queries, suppose I want the metadata changed on 2015-02-11

  1. dateFrom:
    2015-02-11
  2. dateTo:
    2015-02-11

The query created in Lucene is like this (that obviously is not going to return the correct values):

+changeDate:[2015-02-10T23:00:00.000Z TO 2015-02-10T23:00:00.000Z]

I think we should send the dates from the UI including the time:

  1. dateFrom:
    2015-02-11T:00:00:00
  2. dateTo:
    2015-02-11:T:23:59:59

This works a bit better, but doesn’t avoid the issues with the conversion to UTC:

+changeDate:[2015-02-10T23:00:00.000Z TO 2015-02-11T22:59:59.000Z]

Any feedback on this would be great, as now the date queries are not accurate.

Regards,

Jose García

···

GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on GeoServer and GeoNetwork. Visit http://geocat.net for details.


Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net