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

Shai Erera commented on LUCENE-4893:
------------------------------------

I don't think it's a bug. FacetsCollector is stateless in the sense that it 
doesn't \*remember\* if it computed the results already or not. Why do you call 
it multiple times? Usually the usage is to compute FacetResult once, then use 
it wherever you need it. We could make FacetsCollector behave e.g. like 
TopDocsCollector, where after you call topDocs() once, it drains its PQ and the 
subsequent calls fail (or returns an empty TopDocs). In either case, the 
Collector doesn't remember the returned result. Therefore I suggest that you 
modify your code to call it only once.
                
> Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as 
> FacetCollector.getFacetResults is called.
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-4893
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4893
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/facet
>    Affects Versions: 4.2
>            Reporter: crocket
>
> In lucene 4.1, only StandardFacetsAccumulator could be instantiated.
> And as of lucene 4.2, it became possible to instantiate FacetsAccumulator.
> I invoked FacetCollector.getFacetResults twice, and I saw doubled facet 
> counts.
> If I invoke it three times, I see facet counts multiplied three times.
> It all happens in FacetsAccumulator.accumulate.
> StandardFacetsAccumulator doesn't have this bug since it frees facetArrays 
> whenever StandardFacetsAccumulator.accumulate is called.
> Is it a feature or a bug?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to