mirror of https://github.com/apache/lucene.git
SOLR-1037 -- DIH should not add null values in a row returned by EntityProcessor to documents.
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@747707 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c8e94bec4b
commit
aea2aff871
|
@ -152,6 +152,9 @@ Bug Fixes
|
|||
18.SOLR-1024: Calling abort on DataImportHandler import commits data instead of calling rollback.
|
||||
(shalin)
|
||||
|
||||
19.SOLR-1037: DIH should not add null values in a row returned by EntityProcessor to documents.
|
||||
(shalin)
|
||||
|
||||
Documentation
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -460,19 +460,24 @@ public class DocBuilder {
|
|||
Collection collection = (Collection) value;
|
||||
if (multiValued) {
|
||||
for (Object o : collection) {
|
||||
doc.addField(name, o, boost);
|
||||
if (o != null)
|
||||
doc.addField(name, o, boost);
|
||||
}
|
||||
} else {
|
||||
if (doc.getField(name) == null)
|
||||
for (Object o : collection) {
|
||||
doc.addField(name, o, boost);
|
||||
break;
|
||||
if (o != null) {
|
||||
doc.addField(name, o, boost);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (multiValued) {
|
||||
doc.addField(name, value, boost);
|
||||
if (value != null) {
|
||||
doc.addField(name, value, boost);
|
||||
}
|
||||
} else {
|
||||
if (doc.getField(name) == null)
|
||||
if (doc.getField(name) == null && value != null)
|
||||
doc.addField(name, value, boost);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue