Package org.apache.solr.search

Examples of org.apache.solr.search.DocIterator


      return "(" + query1 + " OR " + query2 + ")";
  }

  private static int appendDocs(DocSlice searchResult, int offset, int[] docList, float[] scoreList, int maxCount) {
    boolean hasScores = searchResult.hasScores();
    DocIterator iterator = searchResult.iterator();
    int count = offset;

    while (iterator.hasNext() && (maxCount <= 0 || count < maxCount)) {
      int docId = iterator.nextDoc();

      // don't add any duplicate documents
      if (docExists(docId, docList))
        continue;

      // add the doc to the total doc list
      docList[count] = docId;
      if (hasScores) {
        scoreList[count] = iterator.score();
      }
      count++;
    }

    return count;
View Full Code Here


   
    // get the matches
    this.setMatches(docSlice.matches());
   
    // retrieve all the documents
    DocIterator iterator = docSlice.iterator();
    while (iterator.hasNext()) {
      int docId = iterator.nextDoc();
      float score = 1.0f;     
      if (docSlice.hasScores())
        score = iterator.score();
     
      ScoredSolrDoc doc = new ScoredSolrDoc(docId, score);
     
      // retrieve requested field values
      if (fieldSet != null) {
View Full Code Here

    public void process(ResponseBuilder rb) throws IOException
    {
       
        DocList list = rb.getResults().docList;

        DocIterator it = list.iterator();

        List<Integer> docIds = new ArrayList<Integer>(list.size());
       
        while (it.hasNext())
            docIds.add(it.next());

        if(logger.isDebugEnabled())
            logger.debug("Fetching " + docIds.size() + " Docs");

        if (docIds.size() > 0)
View Full Code Here

TOP

Related Classes of org.apache.solr.search.DocIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.