[jira] [Commented] (LUCENE-4893) Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as FacetsCollector.getFacetResults is called.

2013-03-31 Thread Michael McCandless (JIRA)

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

Michael McCandless commented on LUCENE-4893:


+1, thanks Shai!

> Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as 
> FacetsCollector.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
> Attachments: LUCENE-4893.patch, LUCENE-4893.patch, LUCENE-4893.patch, 
> LUCENE-4893.patch
>
>
> In lucene 4.1, only StandardFacetsAccumulator could be instantiated.
> And as of lucene 4.2, it became possible to instantiate FacetsAccumulator.
> I invoked FacetsCollector.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



[jira] [Commented] (LUCENE-4893) Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as FacetsCollector.getFacetResults is called.

2013-03-31 Thread Michael McCandless (JIRA)

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

Michael McCandless commented on LUCENE-4893:


I think caching the result (so .getXXX acts like a normal getter) is good?

> Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as 
> FacetsCollector.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
> Attachments: LUCENE-4893.patch, LUCENE-4893.patch, LUCENE-4893.patch
>
>
> In lucene 4.1, only StandardFacetsAccumulator could be instantiated.
> And as of lucene 4.2, it became possible to instantiate FacetsAccumulator.
> I invoked FacetsCollector.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



[jira] [Commented] (LUCENE-4893) Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as FacetsCollector.getFacetResults is called.

2013-03-31 Thread Shai Erera (JIRA)

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

Shai Erera commented on LUCENE-4893:


That would mean FacetsCollector will need to track whether getFacetResults was 
called or not, and distinguish that from "no results were found". I guess it 
can be done by having matchingDocs set to null by getFacetResults(), and 
initialized in setNextReader, so getFacetResults can check if matchingDocs is 
null, and throw IllegalStateException indicating no search has been performed 
yet (since or not the last call to getFacetResults). TopDocsCollector can be 
fixed like that too, but I prefer in a separate issue.

> Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as 
> FacetsCollector.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
> Attachments: LUCENE-4893.patch, LUCENE-4893.patch
>
>
> In lucene 4.1, only StandardFacetsAccumulator could be instantiated.
> And as of lucene 4.2, it became possible to instantiate FacetsAccumulator.
> I invoked FacetsCollector.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



[jira] [Commented] (LUCENE-4893) Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as FacetsCollector.getFacetResults is called.

2013-03-31 Thread Michael McCandless (JIRA)

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

Michael McCandless commented on LUCENE-4893:


bq. I chose not to throw an exception because TopDocsCollector returns an empty 
TopDocs if called twice.

Actually I think this is bad for TopDocsCollector to do: it's trappy.  I think 
users don't hit this because typically it's IndexSearcher.search that calls 
this method and returns the TopDocs.

I'd rather fix both of these classes to throw an exception if you call their 
"getter" methods more than once, than silently pretending the 2nd time there 
were no results?

> Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as 
> FacetsCollector.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
> Attachments: LUCENE-4893.patch, LUCENE-4893.patch
>
>
> In lucene 4.1, only StandardFacetsAccumulator could be instantiated.
> And as of lucene 4.2, it became possible to instantiate FacetsAccumulator.
> I invoked FacetsCollector.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



[jira] [Commented] (LUCENE-4893) Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as FacetsCollector.getFacetResults is called.

2013-03-31 Thread crocket (JIRA)

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

crocket commented on LUCENE-4893:
-

LUCENE-4893.patch has some typos in comments.

> Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as 
> FacetsCollector.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
> Attachments: LUCENE-4893.patch
>
>
> In lucene 4.1, only StandardFacetsAccumulator could be instantiated.
> And as of lucene 4.2, it became possible to instantiate FacetsAccumulator.
> I invoked FacetsCollector.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



[jira] [Commented] (LUCENE-4893) Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as FacetsCollector.getFacetResults is called.

2013-03-30 Thread Shai Erera (JIRA)

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

Shai Erera commented on LUCENE-4893:


I chose not to throw an exception because TopDocsCollector returns an empty 
TopDocs if called twice. Also, it's harder to distinguish a truly empty result 
(b/c e.g. no results were found) to being called twice.

> Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as 
> FacetsCollector.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
> Attachments: LUCENE-4893.patch
>
>
> In lucene 4.1, only StandardFacetsAccumulator could be instantiated.
> And as of lucene 4.2, it became possible to instantiate FacetsAccumulator.
> I invoked FacetsCollector.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



[jira] [Commented] (LUCENE-4893) Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as FacetsCollector.getFacetResults is called.

2013-03-30 Thread Shai Erera (JIRA)

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

Shai Erera commented on LUCENE-4893:


I didn't want to make FacetsCollector remember the FacetResult it returned, but 
I agree it should be consistent with other collectors. I'll check what 
TopDocsCollector does - exception or empty result, and fix FC accordingly.

> Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as 
> FacetsCollector.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 FacetsCollector.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



[jira] [Commented] (LUCENE-4893) Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as FacetsCollector.getFacetResults is called.

2013-03-30 Thread crocket (JIRA)

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

crocket commented on LUCENE-4893:
-

I assumed FacetsCollector.getFacetResults was a simple getter method, so I 
didn't optimize my code to call it once.

After discovering LUCENE-4893, I modified my code to call it once.

It may be a good idea to throw an exception or return am empty list if one 
calls it again.
There will be only so many lucene beginners with no knowledge of its side 
effects.

> Facet counts in FacetsAccumulator.facetArrays are multiplied as many times as 
> FacetsCollector.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 FacetsCollector.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