// * currently References > Text > Datatype. First present value
// is used
// * non Reference | Text | Datatype values are ignored
if (!ids.isEmpty()) {
// only references -> create reference constraint
query.setConstraint(property.getName(), new ReferenceConstraint(ids));
if (ids.size() != propertyEntry.getValue().size()) {
log.info("Only some of the parsed values of the field {} contain"
+ "references -> will ignore values with missing references");
}
} else if (!texts.isEmpty()) {
// NOTE: This will use OR over all texts. To enforce AND one
// would need to parse a single string with all values e.g. by
// using StringUtils.join(texts," ")
query.setConstraint(property.getName(), new TextConstraint(texts));
if (ids.size() != propertyEntry.getValue().size()) {
log.info("Only some of the parsed values of the field {} are"
+ "of type String -> will ignore non-string values");
}
} else if(!values.isEmpty()){
query.setConstraint(property.getName(), new ValueConstraint(values));
} //else no values ... ignore property
}
//clean up
ids.clear();
texts.clear();
values.clear();
}
//now add constraints for the collected special properties
if(!references.isEmpty()){
//add references constraint
ReferenceConstraint refConstraint = new ReferenceConstraint(references, MODE.all);
query.setConstraint(SpecialFieldEnum.references.getUri(), refConstraint);
}
if(!fullText.isEmpty()){
TextConstraint textConstraint = new TextConstraint(fullText);
query.setConstraint(SpecialFieldEnum.fullText.getUri(), textConstraint);