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

ASF GitHub Bot commented on SOLR-9395:
--------------------------------------

GitHub user softwaredoug opened a pull request:

    https://github.com/apache/lucene-solr/pull/64

    SOLR-9395 -- Add ceil/floor to stats component

    This pull request limits stats calculations based on local params 
floor/ceil calculations. As in the following snippet:
    
    `stats=true&stats.field={!floor=18 ceil=60}employee_age`
    
    Limits to 18-60 inclusive.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/o19s/lucene-solr stats-component-fences

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucene-solr/pull/64.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #64
    
----
commit 97f457b4ede6fb34a21fad21214b4e5711f037b8
Author: Doug Turnbull <[email protected]>
Date:   2016-07-07T20:47:05Z

    Adds fences in stats component

commit 084e8702a04be9c99b271a2fe741f62492022bac
Author: Doug Turnbull <[email protected]>
Date:   2016-07-07T20:53:01Z

    Merge branch 'master' into stats-component-fences

commit 75ac8854285bae41014de38e073aa42d5f9f39de
Author: Doug Turnbull <[email protected]>
Date:   2016-07-28T20:22:48Z

    Adds a test for fence testing

commit cbd5414c1db927a321dd0df4339874ba91f1c450
Author: Doug Turnbull <[email protected]>
Date:   2016-07-28T20:26:21Z

    Merge branch 'master' into stats-component-fences

commit 44763fa6a3b827a68d8c8571b01076824606334c
Author: Doug Turnbull <[email protected]>
Date:   2016-08-02T18:53:58Z

    Change to -MAX_VALUE instead of MIN_VALUE; add "fenced" in response

commit de817bdad4fcb0747f6565ff74593ab04d2ac574
Author: Doug Turnbull <[email protected]>
Date:   2016-08-07T01:45:19Z

    Refactors "fencing" to ceil/floor bounding

commit 02ae7c6ba3f0e22c51d08c3ca3dfe5d469301bc5
Author: Doug Turnbull <[email protected]>
Date:   2016-08-07T02:07:59Z

    Adds test for date bounds

commit 26084192ff96cee19d632c65a0e93ba6f84b628b
Author: Doug Turnbull <[email protected]>
Date:   2016-08-08T19:41:11Z

    Merge remote-tracking branch 'origin/master' into stats-component-fences

commit fb6142c998207df022a9cc16fda88fc9aeb8fefb
Author: Doug Turnbull <[email protected]>
Date:   2016-08-08T19:42:00Z

    Changes boundables to lambdas

----


> Add ceil/floor bounding to stats calculations
> ---------------------------------------------
>
>                 Key: SOLR-9395
>                 URL: https://issues.apache.org/jira/browse/SOLR-9395
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>    Affects Versions: master (7.0)
>            Reporter: Doug Turnbull
>             Fix For: master (7.0)
>
>
> In the pull request to be attached we add optional ceil and floor parameters 
> to a field being computed via the stats component. This bounds the stats 
> calculations to ceil to floor inclusive.
> For example, let's say your searching over all the employees.
> stats=true&stats.field=employee_age
> But you want to focus on employees aged 18-60 for whatever reason. You can 
> reissue this query as
> stats=true&stats.field={!floor=18 ceil=60}employee_age
> This limits the resulting stats calculations to 18-60 inclusive. This 
> functionality also works on date fields (see test in PR).
> Now one question might be, why not do this with a filter query? In many cases 
> you don't necessarily want to filter these documents from the main search 
> results. You just want to eliminate outliers from a specific stats 
> calculation. For example, you search your employee database for "clerks." You 
> still want to see all the clerks, even little 16 year old Timmy. But for this 
> particular calculation you just want to focus on folks of traditional working 
> age for whatever reason.
> Some notes
> - floor/ceil are only supported as local params.
> - works for date and numeric values
> - date math works!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to