QueryHits queryHits = getQueryHits( searcher, calculateTopDocsRetrievalSize(), true ); final int first = firstResult; final int max = max( first, queryHits.getTotalHits() ); final int size = max - first + 1; if ( size <= 0 ) {
QueryHits queryHits = getQueryHits( searcher, calculateTopDocsRetrievalSize() ); final int first = firstResult; final int max = max( first, queryHits.getTotalHits() ); final int size = max - first + 1; if ( size <= 0 ) {
/** * DocumentExtractor returns a traverser over the full-text results (EntityInfo) * This operation is lazy bound: * - the query is executed * - results are not retrieved until actually requested * * DocumentExtractor objects *must* be closed when the results are no longer traversed. */ @Override public DocumentExtractor queryDocumentExtractor() { //keep the searcher open until the resultset is closed //find the directories LazyQueryState openSearcher = buildSearcher(); //FIXME: handle null searcher try { QueryHits queryHits = getQueryHits( openSearcher, calculateTopDocsRetrievalSize(), true ); int max = max( firstResult, queryHits.getTotalHits() ); return buildDocumentExtractor( openSearcher, queryHits, firstResult, max ); } catch (IOException e) { closeSearcher( openSearcher ); throw new SearchException( "Unable to query Lucene index", e ); } }
/** * DocumentExtractor returns a traverser over the full-text results (EntityInfo) * This operation is lazy bound: * - the query is executed * - results are not retrieved until actually requested * * DocumentExtractor objects *must* be closed when the results are no longer traversed. */ @Override public DocumentExtractor queryDocumentExtractor() { //keep the searcher open until the resultset is closed //find the directories LazyQueryState openSearcher = buildSearcher(); //FIXME: handle null searcher try { QueryHits queryHits = getQueryHits( openSearcher, calculateTopDocsRetrievalSize() ); int max = max( firstResult, queryHits.getTotalHits() ); return buildDocumentExtractor( openSearcher, queryHits, firstResult, max ); } catch (IOException e) { closeSearcher( openSearcher ); throw new SearchException( "Unable to query Lucene index", e ); } }