@Override protected boolean _containsGraph(final Node graphNode) { final SolrIndexSearcher.QueryCommand cmd = new SolrIndexSearcher.QueryCommand(); cmd.setQuery(new MatchAllDocsQuery()); cmd.setLen(0); cmd.setFilterList(new TermQuery(new Term(Field.C, asNtURI(graphNode)))); final SolrIndexSearcher.QueryResult result = new SolrIndexSearcher.QueryResult(); try { request.getSearcher().search(result, cmd); return result.getDocListAndSet().docList.matches() > 0; } catch (final Exception exception) { LOGGER.error(MessageCatalog._00113_NWS_FAILURE, exception); throw new SolrException(ErrorCode.SERVER_ERROR, exception); } } }
@Override public boolean hasNext() { try { final SolrIndexSearcher.QueryResult result = new SolrIndexSearcher.QueryResult(); searcher.search(result, queryCommand); LOGGER.debugQuery(queryCommand, result); sentCursorMark = queryCommand.getCursorMark(); nextCursorMark = result.getNextCursorMark(); page = result.getDocListAndSet().docList; return page.size() > 0; } catch (final Exception exception) { throw new RuntimeException(exception); } }
@Override public boolean hasNext() { try { final SolrIndexSearcher.QueryResult result = new SolrIndexSearcher.QueryResult(); searcher.search(result, queryCommand); LOGGER.debugQuery(queryCommand, result); consumer.onDocSet(result.getDocListAndSet().docSet); queryCommand.clearFlags(SolrIndexSearcher.GET_DOCSET); sentCursorMark = queryCommand.getCursorMark(); nextCursorMark = result.getNextCursorMark(); page = result.getDocListAndSet().docList; return page.size() > 0; } catch (final Exception exception) { throw new RuntimeException(exception); } }
QueryResult qr = new QueryResult(); search(qr,qc); return qr.getDocListAndSet();
QueryResult qr = new QueryResult(); search(qr,qc); return qr.getDocListAndSet();
getDocListC(result,qc); return result.getDocListAndSet();
QueryResult qr = new QueryResult(); search(qr,qc); return qr.getDocListAndSet();
QueryResult qr = new QueryResult(); search(qr,qc); return qr.getDocListAndSet();
QueryResult qr = new QueryResult(); search(qr,qc); return qr.getDocListAndSet();
/** * Returns documents matching both <code>query</code> and <code>filter</code> * and sorted by <code>sort</code>. Also returns the compete set of documents * matching <code>query</code> and <code>filter</code> (regardless of <code>offset</code> and <code>len</code>). * <p> * FUTURE: The returned DocList may be retrieved from a cache. * * @param query * @param filter may be null * @param lsort criteria by which to sort (if null, query relevance is used) * @param offset offset into the list of documents to return * @param len maximum number of documents to return * @return DocListAndSet meeting the specified criteria, should <b>not</b> be modified by the caller. * @throws IOException */ public DocListAndSet getDocListAndSet(Query query, DocSet filter, Sort lsort, int offset, int len) throws IOException { QueryCommand qc = new QueryCommand(); qc.setQuery(query) .setFilter(filter) .setSort(lsort) .setOffset(offset) .setLen(len) .setNeedDocSet(true); QueryResult qr = new QueryResult(); search(qr,qc); return qr.getDocListAndSet(); }
@Override public long getStatistic(final Node s, final Node p, final Node o) { final SolrIndexSearcher.QueryResult result = new SolrIndexSearcher.QueryResult(); try { return searcher.search( result, queryCommand(Triple.create(s, p, o), sortSpec())).getDocListAndSet().docList.matches(); } catch (final Exception exception) { LOGGER.error(MessageCatalog._00113_NWS_FAILURE, exception); throw new SolrException(ErrorCode.SERVER_ERROR, exception); } } }
@Override protected int graphBaseSize() { final SolrIndexSearcher.QueryResult result = new SolrIndexSearcher.QueryResult(); try { return searcher.search(result, graphSizeQueryCommand()).getDocListAndSet().docList.matches(); } catch (final Exception exception) { LOGGER.error(MessageCatalog._00113_NWS_FAILURE, exception); throw new SolrException(ErrorCode.SERVER_ERROR, exception); } }
/** * Sets results from a SolrIndexSearcher.QueryResult. */ public void setResult( SolrIndexSearcher.QueryResult result ) { setResults( result.getDocListAndSet() ); if( result.isPartialResults() ) { rsp.getResponseHeader().add( "partialResults", Boolean.TRUE ); } } }