SEARCH-2252: Avoid indexing fields without property definition information.

This commit is contained in:
Angel Borroy
2020-05-20 10:36:06 +02:00
parent 2fd8af7261
commit 7e9602b67f
@@ -2302,9 +2302,10 @@ public class SolrInformationServer implements InformationServer
{
QName propertyQName = property.getKey();
PropertyDefinition propertyDefinition = dataModel.getPropertyDefinition(propertyQName);
// Skip adding Alfresco Fields declared as indexed="false" to SOLR Schema
if (dataModel.getPropertyDefinition(propertyQName).isIndexed())
if (propertyDefinition != null && propertyDefinition.isIndexed())
{
document.addField(FIELD_PROPERTIES, propertyQName.toString());
@@ -2359,6 +2360,12 @@ public class SolrInformationServer implements InformationServer
}
}
else
{
LOGGER.debug("Field '" + propertyQName + "' has not been indexed "
+ (propertyDefinition != null ? "as property definition is not found."
: "as it has been declared as not indexable in the Content Model."));
}
}
}