In my site i have a search bar on my UI where user can search for any specific page which starts with a letter or having that word in the page name. let suppose i have these pages "Check user details", "Check employee details", "User checkout timing details". And now user is searching with the keyword check, so it should return all the pages having word "check"
Solved! Go to Solution.
Views
Replies
Total Likes
You can utilize the nodename predicate to search for pages by their name.
type = cq:Page
path = /content/aem-demo
nodename = *check*
p.limit = -1
Hi @monish_gavali ,
In your query builder map you can use fulltext search functionality.
Something like below:
map.put("path", "/content/<sample-path>");
//searchText would be your variable or user input from search bar
map.put("fulltext", searchText);
map.put("type", "cq:Page");
Thanks
Tarun
Please check below link for exactly similar use case. You have to use full text search query but it needs to be tweaked slightly.
You can utilize the nodename predicate to search for pages by their name.
type = cq:Page
path = /content/aem-demo
nodename = *check*
p.limit = -1
It worked for me but what if i want to create some query in the below thing.
Equivalent XPath Query
/jcr:root/content/aem-demo//element(*, cq:Page)
[
(jcr:like(fn:name(), '%check%'))
]
You can refer to this link for more details.
https://experienceleague.adobe.com/docs/experience-manager-65/assets/JCR_query_cheatsheet-v1.1.pdf?l...
Below query will help
http://localhost:4502/libs/cq/search/content/querydebug.html?_charset_=UTF-8&query=type%3Dcq%3APage%...
type=cq:Page
path=/content/project/ea/en
fulltext=English*
@monish_gavali Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes