Hi I'm having a slight problem with date searching... if i give same date range in search query it seems to be working fine when try to give the different date range and i am not getting result. Ex : select/?defType=dismax&q=[*"2012-02-02T01:30:52Z" TO "2012-02-02T01:30:52Z"*]&qf=scanneddate i am getting result <result name="response" numFound="20" start="0"> if try different date range . ["2012-02-02T01:30:52Z" TO "2011-09-22T22:40:30Z"] there is no record at all .please help me the same.
you have dates in the wrong order in the second query. Try instead:
["2011-09-22T22:40:30Z" TO "2012-02-02T01:30:52Z"]
in general:
[start_date TO end_date]
DmitryOn Fri, May 4, 2012 at 1:10 PM, ayyappan wrote:
> Hi
>
> I'm having a slight problem with date searching... if i give same date
> range in search query it seems to be working fine when try to give the
> different date range and i am not getting result.
>
> Ex :
> select/?defType=dismax&q=[*"2012-02-02T01:30:52Z" TO
> "2012-02-02T01:30:52Z"*]&qf=scanneddate
>
> i am getting result <result name="response" numFound="20" start="0">
>
> if try different date range .
>
> ["2012-02-02T01:30:52Z" TO "2011-09-22T22:40:30Z"]
>
> there is no record at all .please help me the same.
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/problem-wi...
> Sent from the Solr - User mailing list archive at Nabble.com.
>
thanks for quick response. I tried your advice . ["2011-09-22T22:40:30Z" TO "2012-02-02T01:30:52Z"] like that even though i am not getting any result .
unless, something else is wrong, my question would be, if you have the
documents in solr stamped with these dates?
also could try for a test specifying the field name directly:
q=scanneddate:["2011-09-22T22:40:30Z" TO "2012-02-02T01:30:52Z"]
also, in your first e-mail you said you have used
[*"2012-02-02T01:30:52Z" TO "2012-02-02T01:30:52Z"*]
with asterisks *, what scanneddate values did you then get?On Fri, May 4, 2012 at 1:37 PM, ayyappan wrote:
> thanks for quick response.
>
> I tried your advice . ["2011-09-22T22:40:30Z" TO "2012-02-02T01:30:52Z"]
> like that even though i am not getting any result .
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/problem-wi...
> Sent from the Solr - User mailing list archive at Nabble.com.
>
Right, you need to do the explicit qualification of the date field.
dismax parsing is intended to work with text-type fields, not
numeric or date fields. If you attach &debugQuery=on, you'll
see that your "scanneddate" field is just dropped.
Furthermore, dismax was never intended to work with range
queries. Note this from the DisMaxQParserPlugin page:
" extremely simplified subset of the Lucene QueryParser syntax"
I'll expand on this a bit on the Wiki page.
Best
ErickOn Fri, May 4, 2012 at 6:45 AM, Dmitry Kan wrote:
> unless, something else is wrong, my question would be, if you have the
> documents in solr stamped with these dates?
> also could try for a test specifying the field name directly:
>
> q=scanneddate:["2011-09-22T22:40:30Z" TO "2012-02-02T01:30:52Z"]
>
> also, in your first e-mail you said you have used
>
> [*"2012-02-02T01:30:52Z" TO "2012-02-02T01:30:52Z"*]
>
> with asterisks *, what scanneddate values did you then get?
>
> On Fri, May 4, 2012 at 1:37 PM, ayyappan wrote:
>
>> thanks for quick response.
>>
>> I tried your advice . ["2011-09-22T22:40:30Z" TO "2012-02-02T01:30:52Z"]
>> like that even though i am not getting any result .
>>
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/problem-wi...
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>
>
>
> --
> Regards,
>
> Dmitry Kan
Use debugQuery=true to see exactly how the dismax parser sees this query.
Also, since this is a binary query, you can use filter queries
instead. Those use the Lucene syntax.On Fri, May 4, 2012 at 8:14 AM, Erick Erickson wrote:
> Right, you need to do the explicit qualification of the date field.
> dismax parsing is intended to work with text-type fields, not
> numeric or date fields. If you attach &debugQuery=on, you'll
> see that your "scanneddate" field is just dropped.
>
> Furthermore, dismax was never intended to work with range
> queries. Note this from the DisMaxQParserPlugin page:
>
> " extremely simplified subset of the Lucene QueryParser syntax"
>
> I'll expand on this a bit on the Wiki page.
>
>
> Best
> Erick
>
> On Fri, May 4, 2012 at 6:45 AM, Dmitry Kan wrote:
>> unless, something else is wrong, my question would be, if you have the
>> documents in solr stamped with these dates?
>> also could try for a test specifying the field name directly:
>>
>> q=scanneddate:["2011-09-22T22:40:30Z" TO "2012-02-02T01:30:52Z"]
>>
>> also, in your first e-mail you said you have used
>>
>> [*"2012-02-02T01:30:52Z" TO "2012-02-02T01:30:52Z"*]
>>
>> with asterisks *, what scanneddate values did you then get?
>>
>> On Fri, May 4, 2012 at 1:37 PM, ayyappan wrote:
>>
>>> thanks for quick response.
>>>
>>> I tried your advice . ["2011-09-22T22:40:30Z" TO "2012-02-02T01:30:52Z"]
>>> like that even though i am not getting any result .
>>>
>>> --
>>> View this message in context:
>>> http://lucene.472066.n3.nabble.com/problem-wi...
>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>
>>
>>
>>
>> --
>> Regards,
>>
>> Dmitry Kan
In fact I am able to see "scanneddate" field when i added query like this
"responseHeader":{
-----
-----
"q":" ibrahim.hamid 2012-02-02T04:00:52Z",
"qf":" userid scanneddate",
"wt":"json",
"defType":"dismax",
"version":"2.2",
"rows":"50"}},
"response":{"numFound":20,"start":0,"docs":[
{
---
select/?defType=dismax&q=+ibrahim.hamid+2012-02-02T04:00:52Z&qf=+userid+scanneddate&version=2.2&start=0&rows=50&indent=on&wt=json&&debugQuery=on
if i use q=scanneddate:["2011-09-22T22:40:30Z" TO "2012-02-02T01:30:52Z"] . it is working fine . but when i tried with dismax query .it is not working . EX : select/?defType=dismax&q=["2011-09-22T22:40:30Z" TO "2012-02-02T01:30:52Z"]&qf=scanneddate&version=2.2&start=0&rows=50&indent=on&wt=json&&debugQuery=on&true please comment on the same.