Package org.apache.solr.search

Examples of org.apache.solr.search.DocIterator.nextDoc()


      }

      // Highlight each document
      DocIterator iterator = docs.iterator();
      for (int i = 0; i < docs.size(); i++) {
         int docId = iterator.nextDoc();
         Document doc = readDocs[i];
         NamedList docSummaries = new SimpleOrderedMap();
         for (String fieldName : fieldNames) {
            fieldName = fieldName.trim();
            String[] docTexts = doc.getValues(fieldName);


    float maxScore = searchResult.maxScore();
    int matches = searchResult.matches();
    int count = 0;
    DocIterator iterator = searchResult.iterator();
    while (iterator.hasNext()) {
      int docId = iterator.nextDoc();
      float score = iterator.score();
      if (score >= cutoffScore) {
        // keep the search result only if its score is equal to or above the cutoff score
        docList[count] = docId;
        scoreList[count] = score;

    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;

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

TOP
Copyright © 2018 www.massapi.com. 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.