Package org.apache.lucene.index

Examples of org.apache.lucene.index.IndexDeletionPolicy


      // if we only want to replicate on optimize, we need the deletion policy to
      // save the last optimized commit point.
      if (replicateOnOptimize && !replicateOnCommit) {
        IndexDeletionPolicyWrapper wrapper = core.getDeletionPolicy();
        IndexDeletionPolicy policy = wrapper == null ? null : wrapper.getWrappedDeletionPolicy();
        if (policy instanceof SolrDeletionPolicy) {
          SolrDeletionPolicy solrPolicy = (SolrDeletionPolicy)policy;
          if (solrPolicy.getMaxOptimizedCommitsToKeep() < 1) {
            solrPolicy.setMaxOptimizedCommitsToKeep(1);
          }
View Full Code Here


    return infoRegistry;
  }

   private void initDeletionPolicy() {
     PluginInfo info = solrConfig.getPluginInfo(IndexDeletionPolicy.class.getName());
     IndexDeletionPolicy delPolicy = null;
     if(info != null){
       delPolicy = createInstance(info.className,IndexDeletionPolicy.class,"Deletion Policy for SOLR");
       if (delPolicy instanceof NamedListInitializedPlugin) {
         ((NamedListInitializedPlugin) delPolicy).init(info.initArgs);
       }
View Full Code Here

 
  public static IndexWriterConfig createWriterConfig(Config config, PerfRunData runData, OpenMode mode, IndexCommit commit) {
    Version version = Version.valueOf(config.get("writer.version", Version.LUCENE_31.toString()));
    IndexWriterConfig iwConf = new IndexWriterConfig(version, runData.getAnalyzer());
    iwConf.setOpenMode(mode);
    IndexDeletionPolicy indexDeletionPolicy = getIndexDeletionPolicy(config);
    iwConf.setIndexDeletionPolicy(indexDeletionPolicy);
    if(commit != null)
      iwConf.setIndexCommit(commit);
   
View Full Code Here

            indexWriter.close();
            log.debug("closing IndexWriter.");
            indexWriter = null;
        }
        if (indexReader == null) {
            IndexDeletionPolicy idp = getIndexDeletionPolicy();
            IndexReader reader;
            if (idp != null) {
                reader = IndexReader.open(getDirectory(), idp);
            } else {
                reader = IndexReader.open(getDirectory());
View Full Code Here

            indexWriter.close();
            log.debug("closing IndexWriter.");
            indexWriter = null;
        }
        if (indexReader == null) {
            IndexDeletionPolicy idp = getIndexDeletionPolicy();
            IndexReader reader;
            if (idp != null) {
                reader = IndexReader.open(getDirectory(), idp);
            } else {
                reader = IndexReader.open(getDirectory());
View Full Code Here

  public static IndexWriterConfig createWriterConfig(Config config, PerfRunData runData, OpenMode mode, IndexCommit commit) {
    @SuppressWarnings("deprecation")
    Version version = Version.parseLeniently(config.get("writer.version", Version.LUCENE_CURRENT.toString()));
    IndexWriterConfig iwConf = new IndexWriterConfig(version, runData.getAnalyzer());
    iwConf.setOpenMode(mode);
    IndexDeletionPolicy indexDeletionPolicy = getIndexDeletionPolicy(config);
    iwConf.setIndexDeletionPolicy(indexDeletionPolicy);
    if(commit != null)
      iwConf.setIndexCommit(commit);
   
View Full Code Here

            indexWriter.close();
            log.debug("closing IndexWriter.");
            indexWriter = null;
        }
        if (indexReader == null) {
            IndexDeletionPolicy idp = getIndexDeletionPolicy();
            IndexReader reader = IndexReader.open(getDirectory(), idp, false, termInfosIndexDivisor);
            indexReader = new CommittableIndexReader(reader);
        }
        return indexReader;
    }
View Full Code Here

    return infoRegistry;
  }

   private void initDeletionPolicy() {
     PluginInfo info = solrConfig.getPluginInfo(IndexDeletionPolicy.class.getName());
     IndexDeletionPolicy delPolicy = null;
     if(info != null){
       delPolicy = createInstance(info.className,IndexDeletionPolicy.class,"Deletion Policy for SOLR");
       if (delPolicy instanceof NamedListInitializedPlugin) {
         ((NamedListInitializedPlugin) delPolicy).init(info.initArgs);
       }
View Full Code Here

            indexWriter.close();
            log.debug("closing IndexWriter.");
            indexWriter = null;
        }
        if (indexReader == null) {
            IndexDeletionPolicy idp = getIndexDeletionPolicy();
            IndexReader reader = IndexReader.open(getDirectory(), idp, false, termInfosIndexDivisor);
            indexReader = new CommittableIndexReader(reader);
        }
        return indexReader;
    }
View Full Code Here

            indexWriter.close();
            log.debug("closing IndexWriter.");
            indexWriter = null;
        }
        if (indexReader == null) {
            IndexDeletionPolicy idp = getIndexDeletionPolicy();
            IndexReader reader = IndexReader.open(getDirectory(), idp, false, termInfosIndexDivisor);
            indexReader = new CommittableIndexReader(reader);
        }
        return indexReader;
    }
View Full Code Here

TOP

Related Classes of org.apache.lucene.index.IndexDeletionPolicy

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.