You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Dr Oleg Savrasov (JIRA)" <ji...@apache.org> on 2016/11/20 14:48:58 UTC
[jira] [Updated] (SOLR-8998) JSON Facet API child roll-ups
[ https://issues.apache.org/jira/browse/SOLR-8998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dr Oleg Savrasov updated SOLR-8998:
-----------------------------------
Attachment: SOLR_8998.patch
Unfortunately definition like
facet: {
productsCount: "unique(_root_)"
}
assumes iterating one by one through all the facet values and creating appropriate docset for each of them.
In order to leverage algorithm implemented in BlockJoinFieldFacetAccumulator, I propose to introduce a new keyword for JSON facet:
rollup : <Parent documents query>.
The example of request should look like:
curl http://localhost:8983/solr/collection1/query -d 'q={!parent which=type_s:parent}type_s:child&rows=0&
json.facet={
filter_by_children: {
type:query,
q:"type_s:child",
domain: { blockChildren : "type_s:parent" },
facet:{
colors:{
type : terms,
field : COLOR_s,
rollup : "type_s:parent"
},
sizes:{
type : terms,
field : SIZE_s,
rollup : "type_s:parent"
}}}}
The patch for proposed solution is attached. For the above request it returns
facets=={ count:1,
filter_by_children:{count:2,
colors:{buckets:[ {val:Blue, count:1, rollup:1},
{val:Red, count:1, rollup:1} ]},
sizes:{buckets:[ {val:XL, count:2, rollup:1} ]}}}}
See TestFacetRollup.
> JSON Facet API child roll-ups
> -----------------------------
>
> Key: SOLR-8998
> URL: https://issues.apache.org/jira/browse/SOLR-8998
> Project: Solr
> Issue Type: New Feature
> Components: Facet Module
> Reporter: Yonik Seeley
> Attachments: SOLR_8998.patch
>
>
> The JSON Facet API currently has the ability to map between parents and children ( see http://yonik.com/solr-nested-objects/ )
> This issue is about adding a true rollup ability where parents would take on derived values from their children. The most important part (and the most difficult part) will be the external API.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org