[ https://issues.apache.org/jira/browse/SOLR-13272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16930231#comment-16930231 ]
Munendra S N edited comment on SOLR-13272 at 9/16/19 4:44 AM: -------------------------------------------------------------- I have made few changes based on the offline discussion with [~apoorvprecisely]. [^SOLR-13272.patch] h4. Request {code:json} { "pubyear": { "type": "range", "field": "pubyear_i", "intervals": [ { "from": 1990, "to": 1999, "inclusive_to": false, "inclusive_from": true }, { "range": "[2000,2200]" } ] } } {code} * {{from}} and {{to}} are optional when not specified defaults to {{\*}}. So, the user can pass {{\*}} as value for from or to * {{range}} format is similar to {{IntervalFacets}} syntax in Classical Faceting * Reason for supporting two formats ** {{from}} and {{to}} is more flexible and more JSONic ** other {{range}} is similar to classical faceting. So, familiarity to the users h4. Response {code:java} { "buckets": [ { "val": "[2,3]", "count": 200 }, { "val": "[*,6)", "count": 300 } ] } {code} * The default {{key}} is formed based on {{from}}, {{to}}, {{inclusive_to}} and {{inclusive_from}} h3. Changes from Last Patch * Making from and to optional to support {{before}} and {{after}} cases * More test cases (mostly, adopted from range faceting existing tests) * Minor bug fixes * More request validation In the latest patch, I have removed support for custom {{key}}. This is because, when {{refineFacets}} is called only {{bucketVal}} is available. In case of custom key, I couldn't find easier way to get {{low}} and {{high}} from {{bucketVal}} - [here|https://github.com/apache/lucene-solr/blob/2546e7a2ec577b7cfbce3f96c9c69d45d979a2cf/solr/core/src/java/org/apache/solr/search/facet/FacetRange.java#L785] h3. Pending changes * Direct {{other}} and {{include}} support, if needed. There are already ways to achieve this like using {{\*}} * Supporting custom {{key}} Both of the above tasks can be picked up separately. [~mkhludnev] [~ichattopadhyaya] [~ysee...@gmail.com] [~janhoy] [~hossman] Please review. Let me know if Github's PR is needed for review Also, As {{intervals}} is part of range facets, should we just rename it to {{ranges}}? was (Author: munendrasn): I have made few changes based on the offline discussion with [~apoorvprecisely]. [^SOLR-13272.patch] h4. Request {code:json} { "pubyear": { "type": "range", "field": "pubyear_i", "intervals": [ { "from": 1990, "to": 1999, "inclusive_to": false, "inclusive_from": true }, { "range": "[2000,2200]" } ] } } {code} * {{from}} and {{to}} are optional when not specified defaults to {{\*}}. So, the user can pass {{\*}} as value for from or to * {{range}} format is similar to {{IntervalFacets}} syntax in Classical Faceting * Reason for supporting two formats ** {{from}} and {{to}} is more flexible and more JSONic ** other {{range}} is similar to classical faceting. So, familiarity to the users h4. Response {code:java} { "buckets": [ { "val": "[2,3]", "count": 200 }, { "val": "[*,6)", "count": 300 } ] } {code} * The default {{key}} is formed based on {{from}}, {{to}}, {{inclusive_to}} and {{inclusive_from}} h3. Changes from Last Patch * Making from and to optional to support {{before}} and {{after}} cases * More test cases (mostly, adopted from range faceting existing tests) * Minor bug fixes * More request validation In the latest patch, I have removed support custom {{key}}. This is because, when {{refineFacets}} is called only {{bucketVal}} is available. In case of custom key, I couldn't find easier way to get {{low}} and {{high}}. h3. Pending changes * Direct {{other}} and {{include}} support, if needed. There are already ways to achieve this like using {{\*}} * Supporting custom {{key}} Both of the above tasks can be picked up separately. [~mkhludnev] [~ichattopadhyaya] [~ysee...@gmail.com] [~janhoy] [~hossman] Please review. Let me know if Github's PR is needed for review Also, As {{intervals}} is part of range facets, should we just rename it to {{ranges}}? > Interval facet support for JSON faceting > ---------------------------------------- > > Key: SOLR-13272 > URL: https://issues.apache.org/jira/browse/SOLR-13272 > Project: Solr > Issue Type: New Feature > Components: Facet Module > Reporter: Apoorv Bhawsar > Assignee: Ishan Chattopadhyaya > Priority: Major > Attachments: SOLR-13272.patch > > Time Spent: 3h 10m > Remaining Estimate: 0h > > Interval facet is supported in classical facet component but has no support > in json facet requests. > In cases of block join and aggregations, this would be helpful > Assuming request format - > {code:java} > json.facet={pubyear:{type : interval,field : > pubyear_i,intervals:[{key:"2000-2200",value:"[2000,2200]"}]}} > {code} > > PR https://github.com/apache/lucene-solr/pull/597 -- This message was sent by Atlassian Jira (v8.3.2#803003) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org