Set<String> elemNames = getElementNames(query);
// If any element names are specified, it's an ad hoc query and overrides the element set name default. In that
// case, we set setName to FULL instead of SUMMARY so that we can retrieve a CSW:Record and trim out the
// elements that aren't in the elemNames set.
ElementSetName setName = ElementSetName.FULL;
//
// no ElementNames requested: use ElementSetName
//
if((elemNames == null)) {
setName = getElementSetName(query , ElementSetName.SUMMARY);
// elementsetname is FULL: use customized elementset if defined
if(setName.equals(ElementSetName.FULL)) {
final List<CustomElementSet> customElementSets = context.getBean(CustomElementSetRepository.class).findAll();
// custom elementset defined
if(!CollectionUtils.isEmpty(customElementSets)) {
elemNames = new HashSet<String>();
for(CustomElementSet customElementSet : customElementSets) {