[SEARCH-1960]

applied patch for including content value from cachedDoc only if the contentProperty has a fieldname in solr.
This commit is contained in:
eliaporciani
2019-11-28 17:16:18 +01:00
parent 137dd97e3d
commit b39f0b625c

View File

@@ -2367,13 +2367,19 @@ public class SolrInformationServer implements InformationServer
String transformationStatusFieldName = getSolrFieldNameForContentPropertyMetadata(propertyQName, String transformationStatusFieldName = getSolrFieldNameForContentPropertyMetadata(propertyQName,
AlfrescoSolrDataModel.ContentFieldType.TRANSFORMATION_STATUS); AlfrescoSolrDataModel.ContentFieldType.TRANSFORMATION_STATUS);
newDoc.addField(transformationStatusFieldName, cachedDoc.getFieldValue(transformationStatusFieldName)); if (transformationStatusFieldName != null){
newDoc.addField(transformationStatusFieldName, cachedDoc.getFieldValue(transformationStatusFieldName));
}
String transformationExceptionFieldName = getSolrFieldNameForContentPropertyMetadata(propertyQName, String transformationExceptionFieldName = getSolrFieldNameForContentPropertyMetadata(propertyQName,
AlfrescoSolrDataModel.ContentFieldType.TRANSFORMATION_EXCEPTION); AlfrescoSolrDataModel.ContentFieldType.TRANSFORMATION_EXCEPTION);
newDoc.addField(transformationExceptionFieldName, cachedDoc.getFieldValue(transformationExceptionFieldName)); if (transformationExceptionFieldName != null){
String transformationTimeFieldName = getSolrFieldNameForContentPropertyMetadata(propertyQName, newDoc.addField(transformationExceptionFieldName, cachedDoc.getFieldValue(transformationExceptionFieldName));
}
String transformationTimeFieldName = getSolrFieldNameForContentPropertyMetadata(propertyQName,
AlfrescoSolrDataModel.ContentFieldType.TRANSFORMATION_TIME); AlfrescoSolrDataModel.ContentFieldType.TRANSFORMATION_TIME);
newDoc.addField(transformationTimeFieldName, cachedDoc.getFieldValue(transformationTimeFieldName)); if (transformationTimeFieldName != null){
newDoc.addField(transformationTimeFieldName, cachedDoc.getFieldValue(transformationTimeFieldName));
}
// Gets the new content docid and compares to that of the cachedDoc to mark the content as clean/dirty // Gets the new content docid and compares to that of the cachedDoc to mark the content as clean/dirty
String fldName = getSolrFieldNameForContentPropertyMetadata(propertyQName, String fldName = getSolrFieldNameForContentPropertyMetadata(propertyQName,