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

Tommaso Teofili edited comment on OAK-2980 at 6/11/15 3:00 PM:
---------------------------------------------------------------

possible implementation approach in {{SolrQueryIndex}}
{code}
     public long getSize(SizePrecision precision, long max) {
            long estimate = -1;
            switch (precision) {
                case EXACT:
                    // query solr or use Solr result header's 'numFound'
                    // ... 
                    break;
                case APPROXIMATION:
                    // estimate result size
                    estimate = estimator.estimate(plan.getFilter());
                    break;
                case FAST_APPROXIMATION:
                    // use already computed index plan's estimate
                    estimate = plan.getEstimatedEntryCount();
                    break;
            }
            return Math.min(estimate, max);
        }
{code}


was (Author: teofili):
possible implementation approach in {{SolrQueryIndex}}
{code}
     public long getSize(SizePrecision precision, long max) {
            long estimate = -1;
            switch (precision) {
                case EXACT:
                    // query solr or use Solr result header's 'numFound'
                    // ... 
                    break;
                case APPROXIMATION:
                    // estimate result size
                    estimate = estimator.estimate(plan.getFilter());
                    break;
                case FAST_APPROXIMATION:
                    // use already computed index plan's estimate
                    estimate = plan.getEstimatedEntryCount();
                    break;
            }
            return estimate;
        }
{code}

> Fast result size estimate in Solr index
> ---------------------------------------
>
>                 Key: OAK-2980
>                 URL: https://issues.apache.org/jira/browse/OAK-2980
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: solr
>            Reporter: Tommaso Teofili
>            Assignee: Tommaso Teofili
>             Fix For: 1.3.1
>
>
> Fast result size estimate has been implemented in OAK-2928 for Lucene, it'd 
> be good to have it for Solr index too.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to