override public void  Run()
 {
     try
     {
         docs = (sort == null) ? searchable.Search(weight, filter, nDocs) : searchable.Search(weight, filter, nDocs, sort);
     }
     // Store the IOException for later use by the caller of this thread
     catch (System.IO.IOException ioe)
     {
         this.ioe = ioe;
     }
     if (this.ioe == null)
     {
         // if we are sorting by fields, we need to tell the field sorted hit queue
         // the actual type of fields, in case the original list contained AUTO.
         // if the searchable returns null for fields, we'll have problems.
         if (sort != null)
         {
             ((FieldDocSortedHitQueue)hq).SetFields(((TopFieldDocs)docs).fields);
         }
         ScoreDoc[] scoreDocs = docs.scoreDocs;
         for (int j = 0; j < scoreDocs.Length; j++)
         {
             // merge scoreDocs into hq
             ScoreDoc scoreDoc = scoreDocs[j];
             scoreDoc.doc += starts[i];                     // convert doc
             //it would be so nice if we had a thread-safe insert
             lock (hq)
             {
                 if (!hq.Insert(scoreDoc))
                 {
                     break;
                 }
             }                     // no more scores > minScore
         }
     }
 }
示例#2
0
 // this implementation should be removed when the deprecated
 // Searchable#search(Query,Filter,HitCollector) is removed
 public virtual void  Search(Query query, Filter filter, HitCollector results)
 {
     local.Search(query, filter, results);
 }
示例#3
0
 public virtual void  Search(Weight weight, Filter filter, HitCollector results)
 {
     local.Search(weight, filter, results);
 }