ArchiveOrangemail archive

solr-user.lucene.apache.org


(List home) (Recent threads) (34 other Apache Lucene lists)

Subscription Options

  • RSS or Atom: Read-only subscription using a browser or aggregator. This is the recommended way if you don't need to send messages to the list. You can learn more about feed syndication and clients here.
  • Conventional: All messages are delivered to your mail address, and you can reply. To subscribe, send an email to the list's subscribe address with "subscribe" in the subject line, or visit the list's homepage here.
  • High traffic list: 30+ messages per day
  • This list contains about 83,889 messages, beginning Jan 2006
  • 55 messages added yesterday
Report the Spam
This button sends a spam report to the moderator. Please use it sparingly. For other removal requests, read this.
Are you sure? yes no

problem with date searching.

Ad
ayyappan 1336126228Fri, 04 May 2012 10:10:28 +0000 (UTC)
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.
Dmitry Kan 1336126884Fri, 04 May 2012 10:21:24 +0000 (UTC)
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.
>
ayyappan 1336127849Fri, 04 May 2012 10:37:29 +0000 (UTC)
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 .
Dmitry Kan 1336128352Fri, 04 May 2012 10:45:52 +0000 (UTC)
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.
>
Erick Erickson 1336144515Fri, 04 May 2012 15:15:15 +0000 (UTC)
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
Lance Norskog 1336262606Sun, 06 May 2012 00:03:26 +0000 (UTC)
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
ayyappan 1337062733Tue, 15 May 2012 06:18:53 +0000 (UTC)
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"],
        
},
ayyappan 1337062825Tue, 15 May 2012 06:20:25 +0000 (UTC)
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
ayyappan 1337067497Tue, 15 May 2012 07:38:17 +0000 (UTC)
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.
Home | About | Privacy