[ 
https://issues.apache.org/jira/browse/SOLR-741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627176#action_12627176
 ] 

Hoss Man commented on SOLR-741:
-------------------------------

I propose a lot of "more general" things -- but I'm also a fan of simple, 
direct, specific enhancements to solve common problems.  I'm on board with 
adding support for something like this directly to DateField.

Reusing the DateMathParser syntax makes a lot of sense -- it has a lot of 
flexibility and should already be familiar to people doing non trivial things 
with DateField.  Calling it "round" or "roundTo" seems like it would pigeon 
hole it a bit ... perhaps "forceMath" or "appendMath" or "mutate" or something 
that better conveys the idea of "general modification made to all dates"

The downsides: 
# it has no simple syntax for "round up" but it can be expressed somewhat 
verbosely ("+1DAY-1MILLI/DAY" rounds up to the nearest day) 
# it has no notion of "round to the nearest 5 minutes" which some people might 
expect

...but honestly, those could easily be added as new features to DateMathParser  
-- and then they'd benefit this issue as well as general Date Math usages in 
queries (like date faceting)

syntax wise: perhaps "\FOO" could be the round up equivalent of "/FOO" ? ... 
with "/nFOO" and "\nFOO" being the "round down/up to the nearest nth value for 
unit FOO" ?

> Add support for rounding dates in DateField
> -------------------------------------------
>
>                 Key: SOLR-741
>                 URL: https://issues.apache.org/jira/browse/SOLR-741
>             Project: Solr
>          Issue Type: Improvement
>          Components: search
>    Affects Versions: 1.4
>            Reporter: Shalin Shekhar Mangar
>            Priority: Minor
>             Fix For: 1.4
>
>
> As discussed at http://www.nabble.com/Rounding-date-fields-td19203108.html
> Since rounding dates to a coarse value is an often recommended solution to 
> decrease number of unique terms, we should add support for doing this in 
> DateField itself. A number of syntax were proposed, some of them were:
> # <fieldType name="date" class="solr.DateField" 
> sortMissingLast="true"omitNorms="true" roundTo="-1MINUTE" /> (Shalin)
> # <fieldType name="date" class="solr.DateField" sortMissingLast="true" 
> omitNorms="true" round="DOWN_MINUTE" /> (Otis)
> Hoss proposed more general enhancements related to arbitary pre-processing of 
> values prior to indexing/storing using pre-processing analyzers.
> This issue aims to build a consensus on the solution to pursue and to 
> implement that solution inside Solr.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to