lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From herceg_novi <herceg_n...@yahoo.com>
Subject Re: selecting documents older than 4 hours
Date Sat, 03 Apr 2010 16:35:26 GMT

Ok, 

Field type is as follows: 

<fieldType name="date" class="solr.DateField" sortMissingLast="true"
omitNorms="true"/>

<field name="last_update_date" type="date" indexed="true" stored="true"/>

I changed date to 

# date
Wed Mar 31 19:50:48 PDT 2010

Run the query: 
http://localhost:8983/solr/select/?q=last_update_date:[NOW/DAY-7DAYS%20TO%20NOW/HOUR-5HOURS]&fl=last_update_date&debugQuery=true

I should not be getting the 3 entries below with last update date
2010-03-31T19:40:34Z. 

NOW/HOUR-5HOURS evaluates to 2010-03-31T21:00:00 which should not be the
case if the current time is Wed Mar 31 19:50:48 PDT 2010. Is SOLR converting
NOW to GMT time? 

Here is the result: 

<response>

<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">2</int>

<lst name="params">

<str name="q">
last_update_date:[NOW/DAY-7DAYS TO NOW/HOUR-5HOURS]
</str>
<str name="fl">last_update_date</str>
<str name="debugQuery">true</str>
</lst>
</lst>

<result name="response" numFound="3" start="0">

<doc>
<date name="last_update_date">2010-03-31T19:40:34Z</date>
</doc>

<doc>
<date name="last_update_date">2010-03-31T19:40:34Z</date>
</doc>

<doc>
<date name="last_update_date">2010-03-31T19:40:34Z</date>
</doc>
</result>

<lst name="debug">

<str name="rawquerystring">
last_update_date:[NOW/DAY-7DAYS TO NOW/HOUR-5HOURS]
</str>

<str name="querystring">
last_update_date:[NOW/DAY-7DAYS TO NOW/HOUR-5HOURS]
</str>

<str name="parsedquery">
last_update_date:[2010-03-25T00:00:00Z TO 2010-03-31T21:00:00Z]
</str>

<str name="parsedquery_toString">
last_update_date:[2010-03-25T00:00:00 TO 2010-03-31T21:00:00]
</str>

<lst name="explain">

<str name="id1">

1.0 = (MATCH) ConstantScoreQuery(last_update_date:[2010-03-25T00:00:00 TO
2010-03-31T21:00:00]), product of:
  1.0 = boost
  1.0 = queryNorm
</str>

<str name="id2">

1.0 = (MATCH) ConstantScoreQuery(last_update_date:[2010-03-25T00:00:00 TO
2010-03-31T21:00:00]), product of:
  1.0 = boost
  1.0 = queryNorm
</str>

<str name="id3">

1.0 = (MATCH) ConstantScoreQuery(last_update_date:[2010-03-25T00:00:00 TO
2010-03-31T21:00:00]), product of:
  1.0 = boost
  1.0 = queryNorm
</str>
</lst>
<str name="QParser">LuceneQParser</str>

<lst name="timing">
<double name="time">2.0</double>

<lst name="prepare">
<double name="time">1.0</double>

<lst name="org.apache.solr.handler.component.QueryComponent">
<double name="time">1.0</double>
</lst>

<lst name="org.apache.solr.handler.component.FacetComponent">
<double name="time">0.0</double>
</lst>

<lst name="org.apache.solr.handler.component.MoreLikeThisComponent">
<double name="time">0.0</double>
</lst>

<lst name="org.apache.solr.handler.component.HighlightComponent">
<double name="time">0.0</double>
</lst>

<lst name="org.apache.solr.handler.component.StatsComponent">
<double name="time">0.0</double>
</lst>

<lst name="org.apache.solr.handler.component.DebugComponent">
<double name="time">0.0</double>
</lst>
</lst>

<lst name="process">
<double name="time">1.0</double>

<lst name="org.apache.solr.handler.component.QueryComponent">
<double name="time">0.0</double>
</lst>

<lst name="org.apache.solr.handler.component.FacetComponent">
<double name="time">0.0</double>
</lst>

<lst name="org.apache.solr.handler.component.MoreLikeThisComponent">
<double name="time">0.0</double>
</lst>

<lst name="org.apache.solr.handler.component.HighlightComponent">
<double name="time">0.0</double>
</lst>

<lst name="org.apache.solr.handler.component.StatsComponent">
<double name="time">0.0</double>
</lst>

<lst name="org.apache.solr.handler.component.DebugComponent">
<double name="time">1.0</double>
</lst>
</lst>
</lst>
</lst>
</response>
-- 
View this message in context: http://n3.nabble.com/selecting-documents-older-than-4-hours-tp689975p695037.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message