mirror of https://github.com/apache/lucene.git
SOLR-1153 deltaImportQuery should be honored on child entities as well
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@776958 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b54b936fcd
commit
6fe805f80b
|
@ -142,6 +142,7 @@ New Features
|
|||
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)
|
||||
33.SOLR-11153: 'deltaImportQuery' is honored on child entities as well (noble)
|
||||
|
||||
Optimizations
|
||||
----------------------
|
||||
|
|
|
@ -107,18 +107,17 @@ public class SqlEntityProcessor extends EntityProcessorBase {
|
|||
|
||||
public String getQuery() {
|
||||
String queryString = context.getEntityAttribute(QUERY);
|
||||
if (context.currentProcess() == Context.FULL_DUMP
|
||||
|| !context.isRootEntity()) {
|
||||
if (Context.FULL_DUMP.equals(context.currentProcess())) {
|
||||
return queryString;
|
||||
}
|
||||
if (Context.DELTA_DUMP.equals(context.currentProcess())) {
|
||||
String deltaImportQuery = context.getEntityAttribute(DELTA_IMPORT_QUERY);
|
||||
if(deltaImportQuery != null) return deltaImportQuery;
|
||||
}
|
||||
return getDeltaImportQuery(queryString);
|
||||
}
|
||||
|
||||
public String getDeltaImportQuery(String queryString) {
|
||||
String deltaImportQuery = context.getEntityAttribute(DELTA_IMPORT_QUERY);
|
||||
if(deltaImportQuery != null){
|
||||
return resolver.replaceTokens(deltaImportQuery);
|
||||
}
|
||||
public String getDeltaImportQuery(String queryString) {
|
||||
StringBuilder sb = new StringBuilder(queryString);
|
||||
if (SELECT_WHERE_PATTERN.matcher(queryString).find()) {
|
||||
sb.append(" and ");
|
||||
|
|
Loading…
Reference in New Issue