incubator-blur-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gagan Deep Juneja (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BLUR-114) Optimize the row fetch code in the indexmanager to take advantage on the new family field.
Date Sat, 01 Jun 2013 19:55:19 GMT

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

Gagan Deep Juneja commented on BLUR-114:
----------------------------------------

Hi Aaron,

Is this what we are looking for?
public static List<Document> fetchDocuments(IndexReader reader, Term term,
      ResetableDocumentStoredFieldVisitor fieldSelector, Selector selector) throws IOException
{
     IndexSearcher indexSearcher = new IndexSearcher(reader);
    int docFreq = reader.docFreq(term);
    BooleanQuery booleanQueryForFamily = null;
    BooleanQuery booleanQuery = null;
    if(selector.getColumnFamiliesToFetchSize() > 0){
      booleanQueryForFamily = new BooleanQuery();
      for(String familyName : selector.getColumnFamiliesToFetch()){
        booleanQueryForFamily.add(new TermQuery(new Term(BlurConstants.FAMILY,familyName)),BooleanClause.Occur.SHOULD);
      }
      booleanQuery = new BooleanQuery();
      booleanQuery.add(new TermQuery(term), BooleanClause.Occur.MUST);
      booleanQuery.add(booleanQueryForFamily, BooleanClause.Occur.MUST);
    }
    Query query = booleanQuery == null ? new TermQuery(term) : booleanQuery;
    TopDocs topDocs = indexSearcher.search(query, docFreq);
    int totalHits = topDocs.totalHits;
    .....
 ......
}

Regards,
Gagan
                
> Optimize the row fetch code in the indexmanager to take advantage on the new family field.
> ------------------------------------------------------------------------------------------
>
>                 Key: BLUR-114
>                 URL: https://issues.apache.org/jira/browse/BLUR-114
>             Project: Apache Blur
>          Issue Type: Improvement
>    Affects Versions: 0.1.5
>            Reporter: Aaron McCurry
>             Fix For: 0.1.5
>
>
> This could help fetch performance by not having to walk the entire row of records looking
for the correct family records.

--
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

Mime
View raw message