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:
Shalin Shekhar Mangar 2009-02-25 08:31:25 +00:00
parent c8e94bec4b
commit aea2aff871
2 changed files with 13 additions and 5 deletions

View File

@ -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
----------------------

View File

@ -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);
}
}