This is an automated email from the ASF dual-hosted git repository.

vishesh pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.19 by this push:
     new edf7394919f server: search template name and display text if keyword 
is passed (#9215)
edf7394919f is described below

commit edf7394919fa29b2e0c2ebec5b624b5dde7dedf6
Author: Wei Zhou <[email protected]>
AuthorDate: Tue Jun 11 16:05:43 2024 +0200

    server: search template name and display text if keyword is passed (#9215)
---
 server/src/main/java/com/cloud/api/query/QueryManagerImpl.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java 
b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
index dc591e8f30c..bba5c02151a 100644
--- a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
@@ -4637,8 +4637,12 @@ public class QueryManagerImpl extends 
MutualExclusiveIdsManagerBase implements Q
         // other criteria
 
         if (keyword != null) {
-            sc.addAnd("name", SearchCriteria.Op.LIKE, "%" + keyword + "%");
-        } else if (name != null) {
+            SearchCriteria<TemplateJoinVO> scc = 
_templateJoinDao.createSearchCriteria();
+            scc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%");
+            scc.addOr("displayText", SearchCriteria.Op.LIKE, "%" + keyword + 
"%");
+            sc.addAnd("name", SearchCriteria.Op.SC, scc);
+        }
+        if (name != null) {
             sc.addAnd("name", SearchCriteria.Op.EQ, name);
         }
 

Reply via email to