Hi All,
I have a query regarding the search in JCR:content,
1. In the AEM using QueryBuilder. When I try searching with keyword "
KalmKap®" the trademark symbols are not getting searched. Instead of that it is searching for the keyword "Kalmkap".
2. The special characters like "[", "]", "{", "}", and many..... my search is not working...
Below is my Query::
group.1_fulltext.relPath=jcr:content/@jcr:title
group.1_fulltext=[KalmKap]
group.1_fulltext.relPath=jcr:content/@jcr:title
group.1_fulltext=KalmKap®
kindly help me out on this........
Solved! Go to Solution.
Views
Replies
Total Likes
If you want to do this only with QueryBuilder then create custom predicate
e.g.
Code:
aem63app-repo/CaseInsensitiveLikePredicate.java at master · arunpatidar02/aem63app-repo · GitHub
Query
path=/content/we-retail/us/en/products
caseinsensitive.property=jcr:content/@jcr:title
caseinsensitive.value=%portland®%
Views
Replies
Total Likes
Hi,
I am not sure if this is the bug or design issue. But you can try same with SQL2 or QueryBuilder API.
In XPATH you can run like below:
/jcr:root/content/AEM63App/en//*
[
(jcr:contains(., 'KalmKap(®)?'))
]
Hi @arunpatidar ,
We're using jcr SQL2 and below mentioned is my query :
SELECT * FROM [cq:PageContent] AS s WHERE ISDESCENDANTNODE([/content/somepath]) AND (CONTAINS(s.[subtitle],"*home-page*") OR CONTAINS(s.[jcr:title],"*home-page*") OR CONTAINS(s.[jcr:description],"*home-page*"))
On search of text ("home-page") containing a special character, I get zero results. However, I do have 'home-page' in content nodes as per given conditions.
Could you please help me to correct my query to get results for text having a special character?
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi @arunpatidar,
Thanks for your response.
I'm not sure how did my shared query work for you. Also, I did try your query, still no results. I'm unable to search any keyword with a special character in between like i-phone, e-niro, e-commerce, mobile-phones whereas all these texts exist in my aem content node in jcr:title/jcr:description which should satisfy conditions in my query and show results on search.
Views
Replies
Total Likes
which version are you using?
I am using 6.5 and it is working for me.
Views
Replies
Total Likes
I think you should save the text using hex code for ® symbol. It will be ® .
Views
Replies
Total Likes
Nice suggestion veena!
Views
Replies
Total Likes
No that didn't work.... still my results are KalmKap.
Views
Replies
Total Likes
Ohk. Will check on this and tell you . Did you try Arun's solution ?
Views
Replies
Total Likes
Tried with Arun's solution... But that didn't work.Arun Patidar
Views
Replies
Total Likes
Hi Sai,
I gave try for XPATH query again,
works for me.
1. Result with query which you were trying; gives result for both demoText® and demoText
2. Result with below query gives only result which contains at least one ®
If you are not able to get the desire results you can try JAVA API for Search.
Thanks
Arun
Views
Replies
Total Likes
@arunpatidar Is there any way for when we search for demoText® Search we get only pages which have demoText® and not demoText.
As right now it shows for both demoText® and demoText.
I need to get the pages with only demoText® when i searched for demoText®.
Views
Replies
Total Likes
You can try using like operator.
Views
Replies
Total Likes
For us ,we will have full text content search not a property search.
One Page has 97 and one page has 97%.
I want to restrict Page with "97" to be shown in the search results when i search with fulltext=97%.
I just want the search results which have 97% in the page not 97.
Can this be done with Fulltext search
Views
Replies
Total Likes
Hi,
We could achieve your requirement by using the below query. We'd suggest you to give it a try and check if it works.
For trying the below query, go to "/content/we-retail/ca/en/men" and change jcr:title property in title component to "Featured products ®". Then hit the following query from http://localhost:4502/libs/cq/search/content/querydebug.html
path=/content/we-retail/ca/en/men
property=jcr:title
property.operation=like
property.value=%®%
p.limit=-1
You should see the result now.
Hope this helps!
Regards,
Views
Replies
Total Likes
Hi Arun Patidar
I tried your method, still i'm not getting expected results..
Below without (®)?
With (®)?
Can you provide reference for JAVA API Search.
Thanks,
Sai.
Views
Replies
Total Likes
Hi,
Can you try above query suggested by
/jcr:root/content/we-retail/us/en/products//element(*, cq:Page)
[
(jcr:like(jcr:content/@jcr:title, '%Portland®%'))
]
For Java you can either use QueryBuilderAPI or SQL2 queries.
9 JCR-SQL2 Queries Every AEM Developer Should Know - Blog - 6D Global
https://helpx.adobe.com/experience-manager/using/querying-experience-manager-data-using1.html
http://drfits.com/jcr-sql2-query-with-examples/
Thanks
Arun
Views
Replies
Total Likes
Thanks Techaspect Solutions, Arun Patidar...
Using like operator it is working as expected.
Thanks,
Sai.
Views
Replies
Total Likes
Hi Arun,
Using like operator is case sensitive. Please provide any suggestion to make it case insensitive. I tried using
property=fn:lower-case(jcr:content/@jcr:title)
property.value=%kalmkap®%
property.operation=like
but it didn't generate the X-Path in query debugger and no results found.
Any suggestions for using query builder.
Thanks,
Sai Kumar.
Views
Replies
Total Likes
Hi,
fn:lower-case is not supported anymore with QueryBuilder.
Though you can use same with Xpath like below.
/jcr:root/content/we-retail/us/en/products//element(*, cq:Page)
[
(jcr:like(fn:lower-case(jcr:content/@jcr:title), '%portland®%'))
]
Views
Replies
Total Likes