SOLR-1092 -- Added a new command named 'import' which does not automatically clean the index

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@770980 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2009-05-02 19:50:25 +00:00
parent c1b5873565
commit 99a48e5604
3 changed files with 10 additions and 2 deletions

View File

@ -139,6 +139,10 @@ New Features
31.SOLR-1127: Add support for field name to be templatized. 31.SOLR-1127: Add support for field name to be templatized.
(Noble Paul, shalin) (Noble Paul, shalin)
32.SOLR-1092: Added a new command named 'import' which does not automatically clean the index. This is useful and
more appropriate when one needs to import only some of the entities.
(Noble Paul via shalin)
Optimizations Optimizations
---------------------- ----------------------
1. SOLR-846: Reduce memory consumption during delta import by removing keys when used 1. SOLR-846: Reduce memory consumption during delta import by removing keys when used

View File

@ -16,6 +16,7 @@
*/ */
package org.apache.solr.handler.dataimport; package org.apache.solr.handler.dataimport;
import static org.apache.solr.handler.dataimport.DataImporter.IMPORT_CMD;
import org.apache.solr.common.SolrException; import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.params.CommonParams; import org.apache.solr.common.params.CommonParams;
@ -171,7 +172,8 @@ public class DataImportHandler extends RequestHandlerBase implements
message = DataImporter.MSG.CMD_RUNNING; message = DataImporter.MSG.CMD_RUNNING;
} else if (command != null) { } else if (command != null) {
if (DataImporter.FULL_IMPORT_CMD.equals(command) if (DataImporter.FULL_IMPORT_CMD.equals(command)
|| DataImporter.DELTA_IMPORT_CMD.equals(command)) { || DataImporter.DELTA_IMPORT_CMD.equals(command) ||
IMPORT_CMD.equals(command)) {
UpdateRequestProcessorChain processorChain = UpdateRequestProcessorChain processorChain =
req.getCore().getUpdateProcessingChain(params.get(UpdateParams.UPDATE_PROCESSOR)); req.getCore().getUpdateProcessingChain(params.get(UpdateParams.UPDATE_PROCESSOR));

View File

@ -480,7 +480,7 @@ public class DataImporter {
verbose = "true".equals(requestParams.get("verbose")) verbose = "true".equals(requestParams.get("verbose"))
|| "on".equals(requestParams.get("verbose")); || "on".equals(requestParams.get("verbose"));
} }
if (DELTA_IMPORT_CMD.equals(command)) { if (DELTA_IMPORT_CMD.equals(command) || IMPORT_CMD.equals(command)) {
clean = false; clean = false;
} }
if (requestParams.containsKey("commit")) if (requestParams.containsKey("commit"))
@ -539,6 +539,8 @@ public class DataImporter {
public static final String FULL_IMPORT_CMD = "full-import"; public static final String FULL_IMPORT_CMD = "full-import";
public static final String IMPORT_CMD = "import";
public static final String DELTA_IMPORT_CMD = "delta-import"; public static final String DELTA_IMPORT_CMD = "delta-import";
public static final String ABORT_CMD = "abort"; public static final String ABORT_CMD = "abort";