Multiple value support

This commit is contained in:
Fabio Sinibaldi 2022-10-24 16:36:00 +02:00
parent 3da2170e9f
commit 7f8497e12a
1 changed files with 7 additions and 2 deletions

View File

@ -213,8 +213,13 @@ public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPlugin
for(MappingObject m : getMappings(useCaseDescriptor)){
List<Object> foundValues = documentNavigator.getByPath(m.getPath());
Object toSetValue=null;
if(!foundValues.isEmpty())
toSetValue=foundValues.get(0);
if(!foundValues.isEmpty()) {
// NB CSV for multiple values
StringBuilder b=new StringBuilder();
foundValues.forEach(v->b.append(v+","));
b.deleteCharAt(b.length()-1);
toSetValue = b.toString();
}
log.trace("Setting {} = {} in centroid doc ",m.getName(),toSetValue);
centroidDoc.put(m.getName(),toSetValue);
}