lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandro Zbinden <zbin...@imagic.ch>
Subject AW: Exact Date Search
Date Thu, 03 Oct 2013 11:00:53 GMT
Hey Soumik

Did you read the http://wiki.apache.org/solr/SolrQuerySyntax page. It has some examples with
dates.

It is important that you index your field as a solr date field <fieldType name="date" class="solr.DateField"/>


1. Exact Matching: q= modify_date:" 2012-07-06T9:23:43Z "
2. Less than: q= modify_date:{* TO 2012-07-06T9:23:43Z }
3. More than: q= modify_date:{ 2012-07-06T9:23:43Z TO *}

4. Less or equal than: modify_date:[* TO 2012-07-06T9:23:43Z]
5. More or equal than: modify_date:[ 2012-07-06T9:23:43Z TO *]

Bests Sandro Zbinden


-----Urspr√ľngliche Nachricht-----
Von: soumikghosh05 [mailto:soumikghosh05@yahoo.co.in] 
Gesendet: Donnerstag, 3. Oktober 2013 10:19
An: solr-user@lucene.apache.org
Betreff: Exact Date Search

I have a date filed modify_date and the field value is 2012-08-09T11:23:43Z , 2011-09-02T12:23:43Z
and 2012-07-06T9:23:43Z for 3 docs.

User provided a date in the search form for an example  2012-07-06T9:23:43Z.

1. I wanted to get the doc who's modify date is matching with the user supplied date. 
2. I wanted to get the doc who's modify date is less than the user supplied date.  
3. I wanted to get the doc who's modify date is greater than the user supplied date. 

I am using solr.DateFiled as the field type.

I am very new to solr and I need the query syntax for the above 3 queries.

Any help would be great help for me.

Thanks,
Soumik



--
View this message in context: http://lucene.472066.n3.nabble.com/Exact-Date-Search-tp4093273.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message