[jira] [Comment Edited] (SOLR-9395) Add ceil/floor bounding to stats calculations
[ https://issues.apache.org/jira/browse/SOLR-9395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15413459#comment-15413459 ] Doug Turnbull edited comment on SOLR-9395 at 8/9/16 12:41 PM: -- Thanks [~hossman] and [~dsmiley] Lots of good ideas. I'm going to try with the JSON Facets [~dsmiley] To your point [~hossman], does {{query}} return exists false if the query doesn't match? If that's the case, perhaps this could be achieved with combining a query with a filter query with a range? Something like {quote} stats.field=\{!func\}query($someRangeFilter) {quote} I hadn't tried that, but I wonder if it would work. I'll have to try it and report back... was (Author: softwaredoug): Thanks [~hossman] and [~dsmiley] Lots of good ideas. I'm going to try with the JSON Facets [~dsmiley] To your point [~hossman], does {{query}} return exists false if the query doesn't match? If that's the case, perhaps this could be achieved with combining a query with a filter query with a range? Something like {quote} stats.field={!func}query($someRangeFilter) {quote} I hadn't tried that, but I wonder if it would work. I'll have to try it and report back... > 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=employee_age > But you want to focus on employees aged 18-60 for whatever reason. You can > reissue this query as > stats=true={!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: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Comment Edited] (SOLR-9395) Add ceil/floor bounding to stats calculations
[ https://issues.apache.org/jira/browse/SOLR-9395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15413459#comment-15413459 ] Doug Turnbull edited comment on SOLR-9395 at 8/9/16 12:41 PM: -- Thanks [~hossman] and [~dsmiley] Lots of good ideas. I'm going to try with the JSON Facets [~dsmiley] To your point [~hossman], does {{query}} return exists false if the query doesn't match? If that's the case, perhaps this could be achieved with combining a query with a filter query with a range? Something like {quote} stats.field={!func}query($someRangeFilter) {quote} I hadn't tried that, but I wonder if it would work. I'll have to try it and report back... was (Author: softwaredoug): Thanks [~hossman] and [~dsmiley] Lots of good ideas. I'm going to try with the JSON Facets [~dsmiley] To your point [~hossman], does {{query}} return exists false if the query doesn't match? If that's the case, perhaps this could be achieved with combining a query with a filter query with a range? Something like {{stats.field={!func}query($someRangeFilter)}}. I hadn't tried that, but I wonder if it would work. I'll have to try it and report back... > 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=employee_age > But you want to focus on employees aged 18-60 for whatever reason. You can > reissue this query as > stats=true={!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: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org