for (Fieldable field : fields) {
// assume properties fields use SingleTokenStream
TokenStream tokenStream = field.tokenStreamValue();
TermAttribute termAttribute = tokenStream.addAttribute(TermAttribute.class);
PayloadAttribute payloadAttribute = tokenStream.addAttribute(PayloadAttribute.class);
tokenStream.incrementToken();
tokenStream.end();
tokenStream.close();
String value = new String(termAttribute.termBuffer(), 0, termAttribute.termLength());
if (value.startsWith(namePrefix)) {
// extract value
value = value.substring(namePrefix.length());
// create new named value
Path p = getRelativePath(state, propState);
String path = getNamespaceMappings().translatePath(p);
value = FieldNames.createNamedValue(path, value);
termAttribute.setTermBuffer(value);
doc.add(new Field(field.name(),
new SingletonTokenStream(value, (Payload) payloadAttribute.getPayload().clone())));
doc.add(new Field(
FieldNames.AGGREGATED_NODE_UUID,
false,
parent.getNodeId().toString(),
Field.Store.NO,