problem with date searching.

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with date searching.

ayyappan
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.
Reply | Threaded
Open this post in threaded view
|

Re: problem with date searching.

Dmitry Kan
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]

Dmitry

On Fri, May 4, 2012 at 1:10 PM, ayyappan <[hidden email]> 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-with-date-searching-tp3961761.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



--
Regards,

Dmitry Kan
Reply | Threaded
Open this post in threaded view
|

Re: problem with date searching.

ayyappan
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 .
Reply | Threaded
Open this post in threaded view
|

Re: problem with date searching.

Dmitry Kan
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 <[hidden email]> 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-with-date-searching-tp3961761p3961833.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



--
Regards,

Dmitry Kan
Reply | Threaded
Open this post in threaded view
|

Re: problem with date searching.

Erick Erickson
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 <[hidden email]> 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 <[hidden email]> 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-with-date-searching-tp3961761p3961833.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>
>
>
> --
> Regards,
>
> Dmitry Kan
Reply | Threaded
Open this post in threaded view
|

Re: problem with date searching.

Lance Norskog-2
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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-with-date-searching-tp3961761p3961833.html
>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>
>>
>>
>>
>> --
>> Regards,
>>
>> Dmitry Kan



--
Lance Norskog
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: problem with date searching.

ayyappan
In reply to this post by Erick Erickson
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":[
      {
  ---
--
        "scanneddate":["2012-02-02T04:00:52Z"],
       
},
Reply | Threaded
Open this post in threaded view
|

Re: problem with date searching.

ayyappan
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
Reply | Threaded
Open this post in threaded view
|

Re: problem with date searching.

ayyappan
In reply to this post by Erick Erickson
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.