[
https://issues.apache.org/jira/browse/SOLR-6103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Smiley updated SOLR-6103:
-------------------------------
Attachment: SOLR-6103.patch
I updated LUCENE-5608 with the date range parsing, and now I added the
DateRangeField here with tests. Examples on how to index ranges are below.
Note that they aren't necessarily explicit ranges, it can be implied by
referring specifying a date instance to a desired granularity. It includes the
same syntax Solr supports, though doesn't do "DateMath".
{noformat}
[* TO *]
2014-05-21T12:00:00.000Z
[2000 TO 2014-05-21]
{noformat}
By default, at search time the predicate is intersects, which means it'll match
any overlap with an indexed date range. It can be specified with "op" as a
local-param.
{noformat}
q=dateRange:"2014-05-21"
q={!field f=dateRange op=Contains v="[1999 TO 2001]"}
{noformat}
I opted for this new "op" local-param instead of using Lucene-spatial's awkward
SpatialArgsParser format which looks like "Intersects(foo)".
> Add DateRangeField
> ------------------
>
> Key: SOLR-6103
> URL: https://issues.apache.org/jira/browse/SOLR-6103
> Project: Solr
> Issue Type: New Feature
> Components: spatial
> Reporter: David Smiley
> Assignee: David Smiley
> Attachments: SOLR-6103.patch
>
>
> LUCENE-5648 introduced a date range index & search capability in the spatial
> module. This issue is for a corresponding Solr FieldType to be named
> "DateRangeField". LUCENE-5648 includes a parseCalendar(String) method that
> parses a superset of Solr's strict date format. It also parses partial dates
> (e.g.: 2014-10 has month specificity), and the trailing 'Z' is optional, and
> a leading +/- may be present (minus indicates BC era), and "*" means
> all-time. The proposed field type would use it to parse a string and also
> both ends of a range query, but furthermore it will also allow an arbitrary
> range query of the form {{<calspec> TO <calspec>}} such as:
> {noformat}2000 TO 2014-05-21T10{noformat}
> Which parses as the year 2000 thru 2014 May 21st 10am (GMT).
> I suggest this syntax because it is aligned with Lucene's range query syntax.
>
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]