public Set < String > createLexicalSearchQueryTerms ( Attribute targetAttribute , Set < String > searchTerms ) { Set < String > queryTerms = new HashSet <> ( ) ; if ( searchTerms != null && ! searchTerms . isEmpty ( ) ) { queryTerms . addAll ( searchTerms ) ; } if ( queryTerms . isEmpty ( ) ) { if ( StringUtils . isNotBlank ( targetAttribute . getLabel ( ) ) ) { queryTerms . add ( targetAttribute . getLabel ( ) ) ; } if ( StringUtils . isNotBlank ( targetAttribute . getDescription ( ) ) ) { queryTerms . add ( targetAttribute . getDescription ( ) ) ; } } return queryTerms ; }
A helper function to create a list of queryTerms based on the information from the targetAttribute as well as user defined searchTerms . If the user defined searchTerms exist the targetAttribute information will not be used .