Dirk Rudolph created OAK-7110:
---------------------------------

             Summary: Run rep:facet counting only once per lucene result
                 Key: OAK-7110
                 URL: https://issues.apache.org/jira/browse/OAK-7110
             Project: Jackrabbit Oak
          Issue Type: Improvement
          Components: lucene
    Affects Versions: 1.6.7
            Reporter: Dirk Rudolph
            Priority: Minor


Currently facet counting [(calling 
Facets#getTopChildren)|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndex.java#L1752]
 is called for each facet field for each row. This is because constructing 
[QueryImpl|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L876]
 reads all columns of each row and so it read the facets as well.

This might have a negative impact on performance extracting facets (not proven) 
and can be optimised by caching the counted topChildren for each field in the 
scope of the result, returning the cache result for subsequent calls. 




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to