davidjumani commented on pull request #5307:
URL: https://github.com/apache/cloudstack/pull/5307#issuecomment-901643077


   @nvazquez @shwstppr Will it be a good idea to filter the tags in the DB as 
well ? Might lead to a longer query but I think it'll be fine since I doubt 
there will be dozens of tags
   
   ```
           if (currentVmOffering != null) {
               List<String> tags = 
StringUtils.csvTagsToList(currentVmOffering.getTags());
               SearchBuilder<ServiceOfferingJoinVO> sb = 
_srvOfferingJoinDao.createSearchBuilder();
               for(String tag: tags) {
                   sb.and(tag, sb.entity().getTags(), Op.FIND_IN_SET);
               }
               sb.done();
   
               SearchCriteria<ServiceOfferingJoinVO> scc = sb.create();
               for(String tag: tags) {
                   scc.setParameters(tag, tag);
               }
               sc.addAnd("tags", SearchCriteria.Op.SC, scc);
           }
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to