Hi ,
I am unable to get search result if i am searching with word with special character but from the crx/de i am getting results.Please insight me here and how can i search these french words .
search keyword = fulltext=*Vidéos*
query>ROOT=group: limit=0[
{group=group: or=true[
{1_fulltext=fulltext: relPath=@jcr:content/details/sku, fulltext=*Vidéos*}
{2_fulltext=fulltext: relPath=@jcr:content/jcr:title, fulltext=*Vidéos*}
]}
{path=path: path=}
{type=type: type=cq:Page}
{1_orderby=orderby: sort=dsc, orderby=@jcr:content/cq:lastModified}
]
Views
Replies
Total Likes
D Patty wrote...
Hi ,
I am unable to get search result if i am searching with word with special character but from the crx/de i am getting results.Please insight me here and how can i search these french words .
search keyword = fulltext=*Vidéos*
query>ROOT=group: limit=0[
{group=group: or=true[
{1_fulltext=fulltext: relPath=@jcr:content/details/sku, fulltext=*Vidéos*}
{2_fulltext=fulltext: relPath=@jcr:content/jcr:title, fulltext=*Vidéos*}
]}
{path=path: path=}
{type=type: type=cq:Page}
{1_orderby=orderby: sort=dsc, orderby=@jcr:content/cq:lastModified}
]
Can you please tell me where your not able to get it from Query builder API ?
I tried it in querydebugger in AEM
path=/content
type=cq:Page
1_fulltext=*énglish*
Its working fine i am able get the result.
Hi Patty,
Iam able to get results using query builder. please find the attached screenshot. Please let me know if you need help in querying any french words.
Hi Thanks for you reply.I too can get the result using QueryDebugger client. But my problem is when i am doing it from the code using QueryBuilder Api it is not giving me any result. I had given the generated query from the logs.
Thanks,
Patty
D Patty wrote...
Hi Thanks for you reply.I too can get the result using QueryDebugger client. But my problem is when i am doing it from the code using QueryBuilder Api it is not giving me any result. I had given the generated query from the logs.
Thanks,
Patty
Hi below is the querybuilder api its working fine and giving me result.
QueryBuilder qb = null;
String param = null;
ResourceResolver resourceResolver = req.getResourceResolver();
Map<String, String> map = new HashMap<String, String>();
map.put("path",
"/content");
map.put("type", "cq:Page");
map.put("1_fulltext", "*énglish*");
qb = resourceResolver.adaptTo(QueryBuilder.class);
Query query = qb.createQuery(PredicateGroup.create(map), resourceResolver.adaptTo(Session.class));
SearchResult sr = query.getResult();
if (sr.getHits().size() > 0) {
Log.debug("Found");
} else {
Log.debug("Not Found");
}
Thanks,
Mani Kumar K
D Patty wrote...
Hi ,
I am unable to get search result if i am searching with word with special character but from the crx/de i am getting results.Please insight me here and how can i search these french words .
search keyword = fulltext=*Vidéos*
query>ROOT=group: limit=0[
{group=group: or=true[
{1_fulltext=fulltext: relPath=@jcr:content/details/sku, fulltext=*Vidéos*}
{2_fulltext=fulltext: relPath=@jcr:content/jcr:title, fulltext=*Vidéos*}
]}
{path=path: path=}
{type=type: type=cq:Page}
{1_orderby=orderby: sort=dsc, orderby=@jcr:content/cq:lastModified}
]
Use
Text.escapeIllegalXpathSearchChars(searchTerm); Read this for details https://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/util/Text.html
Note: If passing this term from Front End use sling:encode('searchTerm', 'HTML')
Thanks for your reply.I tried Text.escapeIllegalXpathSearchChars(searchTerm) but seems it is also not working.
D Patty wrote...
Thanks for your reply.I tried Text.escapeIllegalXpathSearchChars(searchTerm) but seems it is also not working.
Ahh sorry I forgot about
The list of characters that are not encoded by the escape() and unescape() METHODS. They contains the characters as defined 'unreserved' in section 2.3 of the RFC 2396 'URI generic syntax':
unreserved = alphanum | mark
mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
Can you try any other special char but these meanwhile I will write a sample code for your * char.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies