Opened 12 years ago

Last modified 12 years ago

#1113 new defect

CSW GetRecords temporal query error

Reported by: plcking Owned by: geonetwork-devel@…
Priority: major Milestone: v2.10.0 RC0
Component: Catalog server Version: v2.6.4
Keywords: Cc:

Description

The time portion(HH:MM:SS) of the 19115 metadata seems to be ignored in the following CSW temporal search(no records returned) :

<?xml version="1.0" encoding="UTF-8"?> <csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" service="CSW" version="2.0.2" resultType="results" outputSchema="http://www.isotc211.org/2005/gmd" maxRecords="1000">

<csw:Query typeNames="dataset,application,datasetcollection,service">

<csw:ElementSetName>full</csw:ElementSetName> <csw:Constraint version="1.1.0">

<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<ogc:And>

<ogc:PropertyIsGreaterThanOrEqualTo>

<ogc:PropertyName>TempExtent_begin</ogc:PropertyName> <ogc:Literal>2011-05-10T10:00:00Z</ogc:Literal>

</ogc:PropertyIsGreaterThanOrEqualTo> <ogc:PropertyIsLessThanOrEqualTo>

<ogc:PropertyName>TempExtent_end</ogc:PropertyName> <ogc:Literal>2011-05-10T18:00:00Z</ogc:Literal>

</ogc:PropertyIsLessThanOrEqualTo>

</ogc:And>

</ogc:Filter>

</csw:Constraint>

</csw:Query>

</csw:GetRecords> <?xml version="1.0" encoding="UTF-8"?> <csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" service="CSW" version="2.0.2" resultType="results" outputSchema="http://www.isotc211.org/2005/gmd" maxRecords="1000">

<csw:Query typeNames="dataset,application,datasetcollection,service">

<csw:ElementSetName>full</csw:ElementSetName> <csw:Constraint version="1.1.0">

<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<ogc:And>

<ogc:PropertyIsGreaterThanOrEqualTo>

<ogc:PropertyName>TempExtent_begin</ogc:PropertyName> <ogc:Literal>2011-05-10T10:00:00Z</ogc:Literal>

</ogc:PropertyIsGreaterThanOrEqualTo> <ogc:PropertyIsLessThanOrEqualTo>

<ogc:PropertyName>TempExtent_end</ogc:PropertyName> <ogc:Literal>2011-05-10T18:00:00Z</ogc:Literal>

</ogc:PropertyIsLessThanOrEqualTo>

</ogc:And>

</ogc:Filter>

</csw:Constraint>

</csw:Query>

</csw:GetRecords>

Pat

Change History (6)

comment:1 by plcking, 12 years ago

sorry for the second csw xml fragment - it is a duplicate of the first.

Pat

comment:2 by jesseeichar, 12 years ago

I just looked at the code here and nothing obvious jumps out. I will make a test when I have time but until then there are a couple things you can do to help:

  1. Set the logger setting: log4j.logger.geonetwork.search to DEBUG. That way you can see the lucene query that is used for the search. You can put that query on this ticket, but you can also use the luke app: http://code.google.com/p/luke/ and run the query on your index using that application to see what is found and play with the parameters until you get what you expect.
  1. Take a look at the class org.fao.geonet.kernel.search.lucenequeries.DateRangeQuery and see if there is anything obviously wrong there. The class in question is: https://github.com/geonetwork/core-geonetwork/blob/2.6.x/web/src/main/java/org/fao/geonet/kernel/search/lucenequeries/DateRangeQuery.java

Jesse

in reply to:  2 ; comment:3 by plcking, 12 years ago

Replying to jesseeichar:

I just looked at the code here and nothing obvious jumps out. I will make a test when I have time but until then there are a couple things you can do to help:

  1. Set the logger setting: log4j.logger.geonetwork.search to DEBUG. That way you can see the lucene query that is used for the search. You can put that query on this ticket, but you can also use the luke app: http://code.google.com/p/luke/ and run the query on your index using that application to see what is found and play with the parameters until you get what you expect.
  1. Take a look at the class org.fao.geonet.kernel.search.lucenequeries.DateRangeQuery and see if there is anything obviously wrong there. The class in question is: https://github.com/geonetwork/core-geonetwork/blob/2.6.x/web/src/main/java/org/fao/geonet/kernel/search/lucenequeries/DateRangeQuery.java

Jesse

Here is the debug output from geonetwork.log(I have checked the metadata for existence of records in this temporal range) :

2012-10-16 08:03:52,923 INFO [jeeves.service] - -> output ended for : csw 2012-10-16 08:03:52,923 INFO [jeeves.service] - -> dispatch ended for : csw 2012-10-16 08:06:58,928 INFO [jeeves.request] - ========================================================== 2012-10-16 08:06:58,928 INFO [jeeves.request] - HTML Request (from 132.156.10.107) : /geonetwork/srv/en/csw 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Method : POST 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Content type : text/xml 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Accept : */* 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Session id is 63997FC626195565DC27C7209095EA20 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Session created for client : 132.156.10.107 2012-10-16 08:06:58,930 INFO [jeeves.service] - Dispatching : csw 2012-10-16 08:06:58,930 DEBUG [jeeves.service] - -> parameters are : <csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" service="CSW" version="2.0.2" resultType="results" outputSchema="http://www.isotc211.org/2005/gmd" maxRecords="2">

<csw:Query typeNames="dataset,application,datasetcollection,service">

<csw:ElementSetName>full</csw:ElementSetName> <csw:Constraint version="1.1.0">

<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<ogc:And>

<ogc:PropertyIsGreaterThanOrEqualTo>

<ogc:PropertyName>TempExtent_begin</ogc:PropertyName> <ogc:Literal>2011-05-10T10:00:00Z</ogc:Literal>

</ogc:PropertyIsGreaterThanOrEqualTo> <ogc:PropertyIsLessThanOrEqualTo>

<ogc:PropertyName>TempExtent_end</ogc:PropertyName> <ogc:Literal>2011-05-10T12:00:00Z</ogc:Literal>

</ogc:PropertyIsLessThanOrEqualTo>

</ogc:And>

</ogc:Filter>

</csw:Constraint>

</csw:Query>

</csw:GetRecords> 2012-10-16 08:06:58,930 INFO [jeeves.webapp.csw] - Received: <csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" service="CSW" version="2.0.2" resultType="results" outputSchema="http://www.isotc211.org/2005/gmd" maxRecords="2">

<csw:Query typeNames="dataset,application,datasetcollection,service">

<csw:ElementSetName>full</csw:ElementSetName> <csw:Constraint version="1.1.0">

<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<ogc:And>

<ogc:PropertyIsGreaterThanOrEqualTo>

<ogc:PropertyName>TempExtent_begin</ogc:PropertyName> <ogc:Literal>2011-05-10T10:00:00Z</ogc:Literal>

</ogc:PropertyIsGreaterThanOrEqualTo> <ogc:PropertyIsLessThanOrEqualTo>

<ogc:PropertyName>TempExtent_end</ogc:PropertyName> <ogc:Literal>2011-05-10T12:00:00Z</ogc:Literal>

</ogc:PropertyIsLessThanOrEqualTo>

</ogc:And>

</ogc:Filter>

</csw:Constraint>

</csw:Query>

</csw:GetRecords> 2012-10-16 08:06:58,931 DEBUG [jeeves.engine] - TransformerFactoryFactory: de.fzi.dbs.xml.transform.CachingTransformerFactory 2012-10-16 08:06:58,931 DEBUG [jeeves.engine] - TransformerFactoryFactory: produces transformer implementation net.sf.saxon.IdentityTransformer 2012-10-16 08:06:58,932 DEBUG [geonetwork.search] - Analyze field tempExtentBegin : 2011-05-10T10:00:00Z 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: tempExtentBegin:[2011-05-10T10:00:00Z TO *] 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Analyze field tempExtentEnd : 2011-05-10T12:00:00Z 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: tempExtentEnd:[* TO 2011-05-10T12:00:00Z] 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: +tempExtentBegin:[2011-05-10T10:00:00Z TO *] +tempExtentEnd:[* TO 2011-05-10T12:00:00Z] 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Analyze field _isTemplate : n 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Analyze field _isTemplate : n 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: _isTemplate:n 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: +(+tempExtentBegin:[2011-05-10T10:00:00Z TO *] +tempExtentEnd:[* TO 2011-05-10T12:00:00Z]) +_isTemplate:n 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Sorting by : [relevance,true] 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Filter string is : <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<ogc:And>

<ogc:PropertyIsGreaterThanOrEqualTo>

<ogc:PropertyName>TempExtent_begin</ogc:PropertyName> <ogc:Literal>2011-05-10T10:00:00Z</ogc:Literal>

</ogc:PropertyIsGreaterThanOrEqualTo> <ogc:PropertyIsLessThanOrEqualTo>

<ogc:PropertyName>TempExtent_end</ogc:PropertyName> <ogc:Literal>2011-05-10T12:00:00Z</ogc:Literal>

</ogc:PropertyIsLessThanOrEqualTo>

</ogc:And>

</ogc:Filter> 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Parsing filter 2012-10-16 08:06:59,031 DEBUG [geonetwork.search] - Setting up the TFC with numHits 3 2012-10-16 08:06:59,824 INFO [jeeves.service] - -> dispatching to output for : csw 2012-10-16 08:06:59,824 INFO [jeeves.service] - -> writing xml for : csw 2012-10-16 08:06:59,824 DEBUG [jeeves.service] - Service xml is : <csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">

<csw:SearchStatus timestamp="2012-10-16T08:06:58" /> <csw:SearchResults numberOfRecordsMatched="0" numberOfRecordsReturned="0" elementSet="full" nextRecord="0" />

</csw:GetRecordsResponse> 2012-10-16 08:06:59,824 INFO [jeeves.service] - -> output ended for : csw 2012-10-16 08:06:59,824 INFO [jeeves.service] - -> dispatch ended for : csw

Pat

in reply to:  3 ; comment:4 by plcking, 12 years ago

Replying to plcking:

Replying to jesseeichar:

I just looked at the code here and nothing obvious jumps out. I will make a test when I have time but until then there are a couple things you can do to help:

  1. Set the logger setting: log4j.logger.geonetwork.search to DEBUG. That way you can see the lucene query that is used for the search. You can put that query on this ticket, but you can also use the luke app: http://code.google.com/p/luke/ and run the query on your index using that application to see what is found and play with the parameters until you get what you expect.
  1. Take a look at the class org.fao.geonet.kernel.search.lucenequeries.DateRangeQuery and see if there is anything obviously wrong there. The class in question is: https://github.com/geonetwork/core-geonetwork/blob/2.6.x/web/src/main/java/org/fao/geonet/kernel/search/lucenequeries/DateRangeQuery.java

Jesse

Here is the debug output from geonetwork.log(I have checked the metadata for existence of records in this temporal range) :

2012-10-16 08:03:52,923 INFO [jeeves.service] - -> output ended for : csw 2012-10-16 08:03:52,923 INFO [jeeves.service] - -> dispatch ended for : csw 2012-10-16 08:06:58,928 INFO [jeeves.request] - ========================================================== 2012-10-16 08:06:58,928 INFO [jeeves.request] - HTML Request (from 132.156.10.107) : /geonetwork/srv/en/csw 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Method : POST 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Content type : text/xml 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Accept : */* 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Session id is 63997FC626195565DC27C7209095EA20 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Session created for client : 132.156.10.107 2012-10-16 08:06:58,930 INFO [jeeves.service] - Dispatching : csw 2012-10-16 08:06:58,930 DEBUG [jeeves.service] - -> parameters are : <csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" service="CSW" version="2.0.2" resultType="results" outputSchema="http://www.isotc211.org/2005/gmd" maxRecords="2">

<csw:Query typeNames="dataset,application,datasetcollection,service">

<csw:ElementSetName>full</csw:ElementSetName> <csw:Constraint version="1.1.0">

<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<ogc:And>

<ogc:PropertyIsGreaterThanOrEqualTo>

<ogc:PropertyName>TempExtent_begin</ogc:PropertyName> <ogc:Literal>2011-05-10T10:00:00Z</ogc:Literal>

</ogc:PropertyIsGreaterThanOrEqualTo> <ogc:PropertyIsLessThanOrEqualTo>

<ogc:PropertyName>TempExtent_end</ogc:PropertyName> <ogc:Literal>2011-05-10T12:00:00Z</ogc:Literal>

</ogc:PropertyIsLessThanOrEqualTo>

</ogc:And>

</ogc:Filter>

</csw:Constraint>

</csw:Query>

</csw:GetRecords> 2012-10-16 08:06:58,930 INFO [jeeves.webapp.csw] - Received: <csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" service="CSW" version="2.0.2" resultType="results" outputSchema="http://www.isotc211.org/2005/gmd" maxRecords="2">

<csw:Query typeNames="dataset,application,datasetcollection,service">

<csw:ElementSetName>full</csw:ElementSetName> <csw:Constraint version="1.1.0">

<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<ogc:And>

<ogc:PropertyIsGreaterThanOrEqualTo>

<ogc:PropertyName>TempExtent_begin</ogc:PropertyName> <ogc:Literal>2011-05-10T10:00:00Z</ogc:Literal>

</ogc:PropertyIsGreaterThanOrEqualTo> <ogc:PropertyIsLessThanOrEqualTo>

<ogc:PropertyName>TempExtent_end</ogc:PropertyName> <ogc:Literal>2011-05-10T12:00:00Z</ogc:Literal>

</ogc:PropertyIsLessThanOrEqualTo>

</ogc:And>

</ogc:Filter>

</csw:Constraint>

</csw:Query>

</csw:GetRecords> 2012-10-16 08:06:58,931 DEBUG [jeeves.engine] - TransformerFactoryFactory: de.fzi.dbs.xml.transform.CachingTransformerFactory 2012-10-16 08:06:58,931 DEBUG [jeeves.engine] - TransformerFactoryFactory: produces transformer implementation net.sf.saxon.IdentityTransformer 2012-10-16 08:06:58,932 DEBUG [geonetwork.search] - Analyze field tempExtentBegin : 2011-05-10T10:00:00Z 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: tempExtentBegin:[2011-05-10T10:00:00Z TO *] 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Analyze field tempExtentEnd : 2011-05-10T12:00:00Z 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: tempExtentEnd:[* TO 2011-05-10T12:00:00Z] 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: +tempExtentBegin:[2011-05-10T10:00:00Z TO *] +tempExtentEnd:[* TO 2011-05-10T12:00:00Z] 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Analyze field _isTemplate : n 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Analyze field _isTemplate : n 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: _isTemplate:n 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: +(+tempExtentBegin:[2011-05-10T10:00:00Z TO *] +tempExtentEnd:[* TO 2011-05-10T12:00:00Z]) +_isTemplate:n 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Sorting by : [relevance,true] 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Filter string is : <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<ogc:And>

<ogc:PropertyIsGreaterThanOrEqualTo>

<ogc:PropertyName>TempExtent_begin</ogc:PropertyName> <ogc:Literal>2011-05-10T10:00:00Z</ogc:Literal>

</ogc:PropertyIsGreaterThanOrEqualTo> <ogc:PropertyIsLessThanOrEqualTo>

<ogc:PropertyName>TempExtent_end</ogc:PropertyName> <ogc:Literal>2011-05-10T12:00:00Z</ogc:Literal>

</ogc:PropertyIsLessThanOrEqualTo>

</ogc:And>

</ogc:Filter> 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Parsing filter 2012-10-16 08:06:59,031 DEBUG [geonetwork.search] - Setting up the TFC with numHits 3 2012-10-16 08:06:59,824 INFO [jeeves.service] - -> dispatching to output for : csw 2012-10-16 08:06:59,824 INFO [jeeves.service] - -> writing xml for : csw 2012-10-16 08:06:59,824 DEBUG [jeeves.service] - Service xml is : <csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">

<csw:SearchStatus timestamp="2012-10-16T08:06:58" /> <csw:SearchResults numberOfRecordsMatched="0" numberOfRecordsReturned="0" elementSet="full" nextRecord="0" />

</csw:GetRecordsResponse> 2012-10-16 08:06:59,824 INFO [jeeves.service] - -> output ended for : csw 2012-10-16 08:06:59,824 INFO [jeeves.service] - -> dispatch ended for : csw

Pat

I also tried using the Luke tool. I had to install version 1 since it would not accept my indexes. I put the following query(copied from the geonetwork log above) into the tool :

+(+tempExtentBegin[2011-05-10T10:00:00Z TO *] + tempExtentEnd:[* TO 2011-05-10T12:00:00Z]) +_isTemplate:n

and 0 results were returned.

in reply to:  4 comment:5 by plcking, 12 years ago

Replying to plcking:

Replying to plcking:

Replying to jesseeichar:

I just looked at the code here and nothing obvious jumps out. I will make a test when I have time but until then there are a couple things you can do to help:

  1. Set the logger setting: log4j.logger.geonetwork.search to DEBUG. That way you can see the lucene query that is used for the search. You can put that query on this ticket, but you can also use the luke app: http://code.google.com/p/luke/ and run the query on your index using that application to see what is found and play with the parameters until you get what you expect.
  1. Take a look at the class org.fao.geonet.kernel.search.lucenequeries.DateRangeQuery and see if there is anything obviously wrong there. The class in question is: https://github.com/geonetwork/core-geonetwork/blob/2.6.x/web/src/main/java/org/fao/geonet/kernel/search/lucenequeries/DateRangeQuery.java

Jesse

Here is the debug output from geonetwork.log(I have checked the metadata for existence of records in this temporal range) :

2012-10-16 08:03:52,923 INFO [jeeves.service] - -> output ended for : csw 2012-10-16 08:03:52,923 INFO [jeeves.service] - -> dispatch ended for : csw 2012-10-16 08:06:58,928 INFO [jeeves.request] - ========================================================== 2012-10-16 08:06:58,928 INFO [jeeves.request] - HTML Request (from 132.156.10.107) : /geonetwork/srv/en/csw 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Method : POST 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Content type : text/xml 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Accept : */* 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Session id is 63997FC626195565DC27C7209095EA20 2012-10-16 08:06:58,929 DEBUG [jeeves.request] - Session created for client : 132.156.10.107 2012-10-16 08:06:58,930 INFO [jeeves.service] - Dispatching : csw 2012-10-16 08:06:58,930 DEBUG [jeeves.service] - -> parameters are : <csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" service="CSW" version="2.0.2" resultType="results" outputSchema="http://www.isotc211.org/2005/gmd" maxRecords="2">

<csw:Query typeNames="dataset,application,datasetcollection,service">

<csw:ElementSetName>full</csw:ElementSetName> <csw:Constraint version="1.1.0">

<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<ogc:And>

<ogc:PropertyIsGreaterThanOrEqualTo>

<ogc:PropertyName>TempExtent_begin</ogc:PropertyName> <ogc:Literal>2011-05-10T10:00:00Z</ogc:Literal>

</ogc:PropertyIsGreaterThanOrEqualTo> <ogc:PropertyIsLessThanOrEqualTo>

<ogc:PropertyName>TempExtent_end</ogc:PropertyName> <ogc:Literal>2011-05-10T12:00:00Z</ogc:Literal>

</ogc:PropertyIsLessThanOrEqualTo>

</ogc:And>

</ogc:Filter>

</csw:Constraint>

</csw:Query>

</csw:GetRecords> 2012-10-16 08:06:58,930 INFO [jeeves.webapp.csw] - Received: <csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" service="CSW" version="2.0.2" resultType="results" outputSchema="http://www.isotc211.org/2005/gmd" maxRecords="2">

<csw:Query typeNames="dataset,application,datasetcollection,service">

<csw:ElementSetName>full</csw:ElementSetName> <csw:Constraint version="1.1.0">

<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<ogc:And>

<ogc:PropertyIsGreaterThanOrEqualTo>

<ogc:PropertyName>TempExtent_begin</ogc:PropertyName> <ogc:Literal>2011-05-10T10:00:00Z</ogc:Literal>

</ogc:PropertyIsGreaterThanOrEqualTo> <ogc:PropertyIsLessThanOrEqualTo>

<ogc:PropertyName>TempExtent_end</ogc:PropertyName> <ogc:Literal>2011-05-10T12:00:00Z</ogc:Literal>

</ogc:PropertyIsLessThanOrEqualTo>

</ogc:And>

</ogc:Filter>

</csw:Constraint>

</csw:Query>

</csw:GetRecords> 2012-10-16 08:06:58,931 DEBUG [jeeves.engine] - TransformerFactoryFactory: de.fzi.dbs.xml.transform.CachingTransformerFactory 2012-10-16 08:06:58,931 DEBUG [jeeves.engine] - TransformerFactoryFactory: produces transformer implementation net.sf.saxon.IdentityTransformer 2012-10-16 08:06:58,932 DEBUG [geonetwork.search] - Analyze field tempExtentBegin : 2011-05-10T10:00:00Z 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: tempExtentBegin:[2011-05-10T10:00:00Z TO *] 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Analyze field tempExtentEnd : 2011-05-10T12:00:00Z 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: tempExtentEnd:[* TO 2011-05-10T12:00:00Z] 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: +tempExtentBegin:[2011-05-10T10:00:00Z TO *] +tempExtentEnd:[* TO 2011-05-10T12:00:00Z] 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Analyze field _isTemplate : n 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Analyze field _isTemplate : n 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: _isTemplate:n 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Lucene Query: +(+tempExtentBegin:[2011-05-10T10:00:00Z TO *] +tempExtentEnd:[* TO 2011-05-10T12:00:00Z]) +_isTemplate:n 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Sorting by : [relevance,true] 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Filter string is : <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">

<ogc:And>

<ogc:PropertyIsGreaterThanOrEqualTo>

<ogc:PropertyName>TempExtent_begin</ogc:PropertyName> <ogc:Literal>2011-05-10T10:00:00Z</ogc:Literal>

</ogc:PropertyIsGreaterThanOrEqualTo> <ogc:PropertyIsLessThanOrEqualTo>

<ogc:PropertyName>TempExtent_end</ogc:PropertyName> <ogc:Literal>2011-05-10T12:00:00Z</ogc:Literal>

</ogc:PropertyIsLessThanOrEqualTo>

</ogc:And>

</ogc:Filter> 2012-10-16 08:06:58,933 DEBUG [geonetwork.search] - Parsing filter 2012-10-16 08:06:59,031 DEBUG [geonetwork.search] - Setting up the TFC with numHits 3 2012-10-16 08:06:59,824 INFO [jeeves.service] - -> dispatching to output for : csw 2012-10-16 08:06:59,824 INFO [jeeves.service] - -> writing xml for : csw 2012-10-16 08:06:59,824 DEBUG [jeeves.service] - Service xml is : <csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">

<csw:SearchStatus timestamp="2012-10-16T08:06:58" /> <csw:SearchResults numberOfRecordsMatched="0" numberOfRecordsReturned="0" elementSet="full" nextRecord="0" />

</csw:GetRecordsResponse> 2012-10-16 08:06:59,824 INFO [jeeves.service] - -> output ended for : csw 2012-10-16 08:06:59,824 INFO [jeeves.service] - -> dispatch ended for : csw

Pat

I also tried using the Luke tool. I had to install version 1 since it would not accept my indexes. I put the following query(copied from the geonetwork log above) into the tool :

+(+tempExtentBegin[2011-05-10T10:00:00Z TO *] + tempExtentEnd:[* TO 2011-05-10T12:00:00Z]) +_isTemplate:n

and 0 results were returned.

Upon inspection of time values in the index using Luke, it was realized that the format of the time codes was YYYY-MM-DDtHH:MM:SSZ and not YYYY-MM-DDTHH:MM:SSZ. I checked my source ISO19115 xml files that I had used for import and the format is indeed YYYY-MM_DDTHH:MM:SSZ. So, the geonetwork import code is lower-casing the 'T' separator. Anyhow, I changed my CSW xml search fragment to use a lowercase 'T' and the query worked ! So, a patch is needed to nullify the lower case conversion. Thanks very much for your excellent advice. If possible, can you provide the source of the changed modules only - I had checked out 2.6.x via svn a month ago. Can you also provide the source modules that were changed for ticket #1105.

Pat

comment:6 by jesseeichar, 12 years ago

Hi, Sorry for taking so long. I can't always find free time to answer right away. For ticket 1105 you can look on github:

https://github.com/geonetwork/core-geonetwork/commit/76fcaf6078022c94444f1fb68f115d2f656c39e3

That is the link to the commit that fixes the bug.

About your finding on this bug:

Most fields when indexed are normalized to some degree. Although this one is probably only lowercased. So you can either change the analyzer used for this field index-fields.xsl might work but probably you need something more advanced. Or you can edit DateRangeQuery.

The correct solution judging from several looks at the code would be to fix the indexing on of the field. On trunk I think I would define a field-specific analyzer for the date fields that you are having problems with. I don't know if config-lucene.xml exists in 2.6.4 but if it does I would start there.

Note: See TracTickets for help on using tickets.