Hello Christopher,

We have a library whose soul purpose it is to extract, parse and validate dates 
found in free text, in all major world languages (and many more) and every in 
thinkable format/notation. It can also deal with times, timezones (resolve them 
back to UTC), different eras (e.g. Buddhist), validate dates (e.g. 2018-1-4) 
and figure out which format is correct (yyyy-m-d or yyyy-d-m) if a day name is 
found somewhere very close to the date. And it supports month names including 
abbreviated format (thanks to Locale).

We use it to get the date for an article/web page on our Sitesearch platform, 
and index it to Solr so we can boost recent articles. But some of our customers 
use it together with a Lucene CharFilter to transform it on-the-fly 
(maintaining offsets and positions for highlighting) when indexing or 
searching, or embedded in a QueryParser.

It is a mature project in on-going development since 2010, but not open source, 
so if you are interested contact us off list.

Regards,
Markus

 
 
-----Original message-----
> From:Shawn Heisey <apa...@elyograg.org>
> Sent: Thursday 16th August 2018 20:09
> To: solr-user@lucene.apache.org
> Subject: Re: Searching by dates
> 
> On 8/16/2018 9:20 AM, Christopher Schultz wrote:
> > Hmm. I could have sworn the documentation I read in the past (maybe as
> > long as 3-4 months ago) indicated that date+timestamp was necessary.
> > Maybe that was just for the index, while the searches can be partial.
> 
> DateRangeField was introduced four years ago, first available in Solr
> version 5.0.
> 
> https://issues.apache.org/jira/browse/SOLR-6103
> 
> > As for i18n, is there a way to have the query analyzer convert strings
> > like "mm/dd/yyyy" into "yyyy-mm-dd"?
> 
> Solr doesn't accept dates in mm/dd/yyyy syntax, and can't convert that
> for you.  The ISO standard that *is* accepted is the more logical
> yyyy-mm-dd.  It's generally best if you don't use a freeform text field
> for dates ... provide a full interface for choosing specific dates so
> that user input is predictable.  Probably something like this:
> 
> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date
> 
> Looking at the documentation, I don't see any way to search for just a
> day without the year.  That could be a useful enhancement for
> birthday-related use cases, but I have no idea how hard it would be to
> write.
> 
> Thanks,
> Shawn
> 
> 

Reply via email to