}
} 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);
//add full text constraint
}
if(similarityContext.length() > 0 && !similarityFields.isEmpty()){
//add similarity constraint