Package org.apache.lucene.index

Examples of org.apache.lucene.index.IndexReader.decRef()


      iw.commit(commitUserData);
    } else {
      IndexReader r = getRunData().getIndexReader();
      if (r != null) {
        r.commit(commitUserData);
        r.decRef();
      } else {
        throw new IllegalStateException("neither IndexWriter nor IndexReader is currently open");
      }
    }
   
View Full Code Here


   
    long t = System.currentTimeMillis();
    IndexReader r = IndexReader.open(w, true);
    runData.setIndexReader(r);
    // Transfer our reference to runData
    r.decRef();

    // TODO: gather basic metrics for reporting -- eg mean,
    // stddev, min/max reopen latencies

    // Parent sequence sets stopNow
View Full Code Here

        }
        reopenTimes[reopenCount++] = delay;
        // TODO: somehow we need to enable warming, here
        runData.setIndexReader(newReader);
        // Transfer our reference to runData
        newReader.decRef();
        r = newReader;
      }
    }
    stopNow = false;
View Full Code Here

                           deletionPolicy,
                           readOnly);
    }
    getRunData().setIndexReader(r);
    // We transfer reference to the run data
    r.decRef();
    return 1;
  }
  @Override
  public void setParams(String params) {
View Full Code Here

      map.put(OpenReaderTask.USER_DATA, userData);
      reader.flush(map);
    } else {
      reader.flush();
    }
    reader.decRef();
    return 1;
  }
}
View Full Code Here

        }
      }
      termDocs.close();
    }
    System.out.println("--> processed (delete) " + numDeleted + " docs");
    r.decRef();
    return numDeleted;
  }
}
View Full Code Here

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.