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

Hoss Man commented on SOLR-12516:
---------------------------------

One complexity in fixing this is the way the refinement requests are currently 
built – when building/parsing the {{\_l}} (and {{\_s + \_p}} ) list(s) the code 
currently assume everything it finds is a bucket value (or a pair of bucket 
value and sub-facet refinement requests) ... there's no intermediate structure 
that says "buckets" like there is in the facet response, so there is no way to 
put "before"/"between"/"after" outside of the list of bucket values to indicate 
what sub-facets need refined -- and putting them in the bucket list seems like 
a hack that could cause problems w/the existing code that expects everything in 
that list to be parsable by the {{Calc}} for this facet.
Perhaps a new {{\_other}} key should be added alongside the existing {{\_l, 
\_s, \_p}} keys that _then_ contains {{\_l, \_s, \_p}} for each of the "other" 
buckets (by name) where a sub-facet needs refinement?

Something like...

{noformat}
    doTestRefine("{top:{type:range, other:all, field:R, start:0, end:1, gap:1, 
facet:{x : {type:terms, field:X, limit:2, refine:true} } } }",
        "{top: {buckets:[{val:0, count:2, x:{buckets:[{val:x1, 
count:5},{val:x2, count:3}]} } ]" +
        "       before:{count:0},after:{count:0}," +
        "       between:{count:2,x:{buckets:[{val:x1, count:5},{val:x2, 
count:3}]} } } }",
        "{top: {buckets:[{val:0, count:1, x:{buckets:[{val:x2, 
count:4},{val:x3, count:2}]} } ]" +
        "       before:{count:0},after:{count:0}," +
        "       between:{count:1,x:{buckets:[{val:x2, count:4},{val:x3, 
count:2}]} } } }",
        null,
        "=={top: {" +
            "_s:[  [0 , {x:{_l:[x1]}} ]  ]" +
            "_other:{_s:[  ['between' , {x:{_l:[x1]}} ]  ] }" +
            "    }  " +
            "}"
    );
{noformat}

?

> JSON "range" facets don't refine sub-facets under special buckets 
> (before,after,between)
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-12516
>                 URL: https://issues.apache.org/jira/browse/SOLR-12516
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Facet Module
>            Reporter: Hoss Man
>            Priority: Major
>         Attachments: SOLR-12516.patch
>
>
> {{FacetRangeMerger extends FacetRequestSortedMerger<FacetRange>}} ... however 
> {{FacetRangeMerger}} does not override {{getRefinement(...)}} which means 
> only {{FacetRequestSortedMerger.buckets}} is evaluated and considered for 
> refinement. The additional, special purpose, {{FacetBucket}} instances 
> tracked in {{FacetRangeMerger}} are never considered for refinement.
> In a simple range facet this doesn't cause any problems because these buckets 
> are returned by every shard on the phase#1 request -- but *if a sub-facet 
> (such as a field facet) is nested under a range facet then the buckets 
> returned by the sub-facets for the before/between/after buckets will never be 
> refined* ... the phase#1 sub-facet buckets will be merged as.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to