diff --git a/search-services/alfresco-search/src/main/java/org/alfresco/solr/SolrInformationServer.java b/search-services/alfresco-search/src/main/java/org/alfresco/solr/SolrInformationServer.java index ebe39eab5..fbed07f15 100644 --- a/search-services/alfresco-search/src/main/java/org/alfresco/solr/SolrInformationServer.java +++ b/search-services/alfresco-search/src/main/java/org/alfresco/solr/SolrInformationServer.java @@ -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.")); + } } }