Package org.apache.solr.search

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


    if( rb.isDebug() ){
      dbg = new SimpleOrderedMap<Object>();
    }

    while( iterator.hasNext() ) {
      int id = iterator.nextDoc();
      int rows = p.getInt( MoreLikeThisParams.DOC_COUNT, 5 );
      DocListAndSet sim = mltHelper.getMoreLikeThis( id, 0, rows, null, null, flags );
      String name = schema.printableUniqueKey( searcher.doc( id ) );
      mlt.add(name, sim.docList);
     


        docDbg.add( "boostedMLTQuery", mltHelper.getBoostedMLTQuery().toString() );
        docDbg.add( "realMLTQuery", mltHelper.getRealMLTQuery().toString() );
        SimpleOrderedMap<Object> explains = new SimpleOrderedMap<Object>();
        DocIterator mltIte = sim.docList.iterator();
        while( mltIte.hasNext() ){
          int mltid = mltIte.nextDoc();
          String key = schema.printableUniqueKey( searcher.doc( mltid ) );
          explains.add( key, searcher.explain( mltHelper.getRealMLTQuery(), mltid ) );
        }
        docDbg.add( "explain", explains );
        dbg.add( name, docDbg );

    }
   
   
    DocIterator iter = docs.iterator();
    while (iter.hasNext()) {
      int docID = iter.nextDoc();
      String raw = si.lookup[si.order[docID]];
      String v;
      if( raw != null ) {
        v = ft.indexedToReadable(raw);
        allstats.accumulate(v);

    FieldQuery fieldQuery = fvh.getFieldQuery( query, searcher.getIndexReader() );

    // Highlight each document
    DocIterator iterator = docs.iterator();
    for (int i = 0; i < docs.size(); i++) {
      int docId = iterator.nextDoc();
      Document doc = searcher.doc(docId, fset);
      NamedList docSummaries = new SimpleOrderedMap();
      for (String fieldName : fieldNames) {
        fieldName = fieldName.trim();
        if( useFastVectorHighlighter( params, schema, fieldName ) )

     
      int index=0;
      int end=this.getend(index);
      DocIterator iter = docset.iterator();
      while (iter.hasNext()) {
        int doc = iter.nextDoc();
        if(doc>=end)
        {
          index=this.readerIndex(doc);
          end=this.getend(index);
        }

        // This is an iterator, but we only handle the first match
        DocIterator iterator = match.iterator();
        if (iterator.hasNext()) {
          // do a MoreLikeThis query for each document in results
          int id = iterator.nextDoc();
          mltDocs = mlt.getMoreLikeThis(id, start, rows, filters, interesting,
              flags);
        }
      } else {
        throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,

    {
      IndexSchema schema = searcher.getSchema();
      NamedList<DocList> mlt = new SimpleOrderedMap<DocList>();
      DocIterator iterator = docs.iterator();
      while( iterator.hasNext() ) {
        int id = iterator.nextDoc();
       
        DocListAndSet sim = getMoreLikeThis( id, 0, rows, null, null, flags );
        String name = schema.printableUniqueKey( reader.document( id ) );

        mlt.add(name, sim.docList);

  public void writeDocList(String name, DocList ids, Set<String> fields, Map otherFields) throws IOException {
    int sz=ids.size();
    SolrIndexSearcher searcher = req.getSearcher();
    DocIterator iterator = ids.iterator();
    for (int i=0; i<sz; i++) {
      int id = iterator.nextDoc();
      Document doc = searcher.doc(id, fields);
      writeDoc(null, doc, fields, (returnScore ? iterator.score() : 0.0f), returnScore);
    }
  }

    writeArrayOpener(sz);

    SolrIndexSearcher searcher = req.getSearcher();
    DocIterator iterator = ids.iterator();
    for (int i=0; i<sz; i++) {
      int id = iterator.nextDoc();
      Document doc = searcher.doc(id, fields);
      writeKey(i, false);
      writeDoc(null, doc, fields, (includeScore ? iterator.score() : 0.0f), includeScore);
    }
    writeMapCloser();

            docList.maxScore());
        DocIterator iterator = docList.iterator();
        if (responseWriter.isStreamingDocs()) {
          responseWriter.startDocumentList(name,info);
          for (int j = 0; j < sz; j++) {
            SolrDocument sdoc = getDoc(iterator.nextDoc(), idxInfo);
            if (idxInfo.includeScore && docList.hasScores()) {
              sdoc.addField(SCORE_FIELD, iterator.score());
            }
            responseWriter.writeDoc(sdoc);
          }

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.