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

Varun Thacker commented on SOLR-4763:
-------------------------------------

I tried out the patch and SimpleFacetsTest.testSimpleGroupedFacets() fails.

Unless my understanding is incorrect, the patch seems to be incorrect. 

This change does not affect anything. That is because this condition will 
always be true - 
{code}
-      segmentTotalCount++;
-      segmentFacetCounts[facetOrd]++;

-        groupedFacetHits.add(new GroupedFacetHit(groupKey, null));
+        if (groupedFacetHits.add(new GroupedFacetHit(groupKey, null))) {
+          segmentTotalCount++;
+          segmentFacetCounts[facetFieldNumTerms]++;
+        }
{code}

The reason being the code will return if that segment does not have the 
necessary values  -  

{code}
if (segmentGroupedFacetHits.exists(segmentGroupedFacetsIndex)) {
        return;
      }
{code}


Also I don't think removing the for loop in setNextReader() is correct. If you 
add this back the test will pass.

I haven't looked into the MultiValued scenario yet but I feel that if it's a 
caching issue the bug will be not at the lucene level.  I'll look into it in 
greater detail.


> Performance issue when using group.facet=true
> ---------------------------------------------
>
>                 Key: SOLR-4763
>                 URL: https://issues.apache.org/jira/browse/SOLR-4763
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.2
>            Reporter: Alexander Koval
>         Attachments: SOLR-4763.patch, SOLR-4763.patch
>
>
> I do not know whether this is bug or not. But calculating facets with 
> {{group.facet=true}} is too slow.
> I have query that:
> {code}
> "matches": 730597,
> "ngroups": 24024,
> {code}
> 1. All queries with {{group.facet=true}}:
> {code}
> "QTime": 5171
> "facet": {
>     "time": 4716
> {code}
> 2. Without {{group.facet}}:
> * First query:
> {code}
> "QTime": 3284
> "facet": {
>     "time": 3104
> {code}
> * Next queries:
> {code}
> "QTime": 230,
> "facet": {
>     "time": 76
> {code}
> So I think with {{group.facet=true}} Solr doesn't use cache to calculate 
> facets.
> Is it possible to improve performance of facets when {{group.facet=true}}?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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

Reply via email to