Source:
<code>public D makeDocument(NodeState state, boolean isUpdate, List<PropertyState> propertiesModified) throws IOException { boolean facet = false; D document = initDoc(); boolean dirty = false; <START> Pattern propertyRegex = definition.getPropertyRegex(); <END> PropertyState nodenamePS = new StringPropertyState(FieldNames.NODE_NAME, getName(path)); for (PropertyState property : Iterables.concat(state.getProperties(), Collections.singleton(nodenamePS))) { String pname = property.getName(); if (!isVisible(pname) && !FieldNames.NODE_NAME.equals(pname)) { continue; } PropertyDefinition pd = indexingRule.getConfig(pname); if (pd == null || !pd.index){ continue; } if (pd.ordered) { dirty |= addTypedOrderedFields(document, property, pname, pd); } dirty |= indexProperty(path, document, state, property, pname, pd); facet |= pd.facet; } boolean[] dirties = indexAggregates(path, document, state); dirty |= dirties[0]; facet |= dirties[1]; dirty |= indexNullCheckEnabledProps(path, document, state); dirty |= indexFunctionRestrictions(path, document, state); dirty |= indexNotNullCheckEnabledProps(path, document, state); dirty |= augmentCustomFields(path, document, state); if (!dirty) { dirty = indexIfSinglePropertyRemoved(propertiesModified); } if (isUpdate && !dirty) { return null; } String name = getName(path); if (indexingRule.isNodeNameIndexed()){ addNodeNameField(document, name); dirty = true; } if(!indexingRule.indexesAllNodesOfMatchingType() && !dirty){ return null; } if (indexingRule.isFulltextEnabled()) { boolean shouldAdd = propertyRegex == null || propertyRegex.matcher(name).find(); if (shouldAdd) { indexFulltextValue(document, name); } } if (definition.evaluatePathRestrictions()){ indexAncestors(document, path); } return finalizeDoc(document, dirty, facet); }</code><technical_language>suggestion</technical_language>

Target:
public D makeDocument(NodeState state, boolean isUpdate, List<PropertyState> propertiesModified) throws IOException { boolean facet = false; D document = initDoc(); boolean dirty = false; PropertyState nodenamePS = new StringPropertyState(FieldNames.NODE_NAME, getName(path)); for (PropertyState property : Iterables.concat(state.getProperties(), Collections.singleton(nodenamePS))) { String pname = property.getName(); if (!isVisible(pname) && !FieldNames.NODE_NAME.equals(pname)) { continue; } PropertyDefinition pd = indexingRule.getConfig(pname); if (pd == null || !pd.index){ continue; } if (pd.ordered) { dirty |= addTypedOrderedFields(document, property, pname, pd); } dirty |= indexProperty(path, document, state, property, pname, pd); facet |= pd.facet; } boolean[] dirties = indexAggregates(path, document, state); dirty |= dirties[0]; facet |= dirties[1]; dirty |= indexNullCheckEnabledProps(path, document, state); dirty |= indexFunctionRestrictions(path, document, state); dirty |= indexNotNullCheckEnabledProps(path, document, state); dirty |= augmentCustomFields(path, document, state); if (!dirty) { dirty = indexIfSinglePropertyRemoved(propertiesModified); } if (isUpdate && !dirty) { return null; } String name = getName(path); if (indexingRule.isNodeNameIndexed()){ addNodeNameField(document, name); dirty = true; } if(!indexingRule.indexesAllNodesOfMatchingType() && !dirty){ return null; } if (indexingRule.isFulltextEnabled()) { Pattern propertyRegex = definition.getPropertyRegex(); boolean shouldAdd = propertyRegex == null || propertyRegex.matcher(name).find(); if (shouldAdd) { indexFulltextValue(document, name); } } if (definition.evaluatePathRestrictions()){ indexAncestors(document, path); } return finalizeDoc(document, dirty, facet); }