mirror of https://github.com/apache/lucene.git
SOLR-1638 -- Fixed NullPointerException during import if uniqueKey is not specified in schema
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@889115 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8e5d7bbbd3
commit
6b71440883
|
@ -31,7 +31,8 @@ Optimizations
|
|||
|
||||
Bug Fixes
|
||||
----------------------
|
||||
|
||||
* SOLR-1638: Fixed NullPointerException during import if uniqueKey is not specified
|
||||
in schema (Akshay Ukey via shalin)
|
||||
|
||||
|
||||
Other Changes
|
||||
|
|
|
@ -149,8 +149,12 @@ public class DataImporter {
|
|||
}
|
||||
|
||||
private void identifyPk(DataConfig.Entity entity) {
|
||||
String schemaPk = schema.getUniqueKeyField().getName();
|
||||
//if no fields are mentioned . solr uniqeKey is same as dih 'pk'
|
||||
SchemaField uniqueKey = schema.getUniqueKeyField();
|
||||
String schemaPk = "";
|
||||
if (uniqueKey != null)
|
||||
schemaPk = uniqueKey.getName();
|
||||
else return;
|
||||
//if no fields are mentioned . solr uniqueKey is same as dih 'pk'
|
||||
entity.pkMappingFromSchema = schemaPk;
|
||||
for (DataConfig.Field field : entity.fields) {
|
||||
if(field.getName().equals(schemaPk)) {
|
||||
|
|
Loading…
Reference in New Issue