mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
SEARCH-2252: Avoid indexing fields without property definition information.
This commit is contained in:
+8
-1
@@ -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."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user