Special Characters Search using Querybuilder | Community
Skip to main content
sai_kumart66079
Level 2
Aug 3, 2018 1:52 AM UTC
Solved

Special Characters Search using Querybuilder

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........

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Aug 20, 2018 6:26 PM UTC

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®%

Arun Patidar

24 replies

arunpatidar
New Participant
Aug 6, 2018 1:24 PM UTC

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

Translate
Arun Patidar
Level 3
Apr 13, 2023 12:05 PM UTC

@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®.

 

Translate
arunpatidar
New Participant
Apr 14, 2023 10:16 AM UTC

You can try using like operator.

Translate
Arun Patidar
sai_kumart66079
Level 2
Aug 6, 2018 1:04 PM UTC

Tried with Arun's solution... But that didn't work.Arun Patidar​

Translate
VeenaVikraman
New Participant
Aug 6, 2018 12:52 PM UTC

Ohk. Will check on this and tell you . Did you try Arun's solution ?

Translate
sai_kumart66079
Level 2
Aug 6, 2018 12:24 PM UTC

No that didn't work.... still my results are KalmKap.

Translate
smacdonald2008
Level 10
Aug 3, 2018 6:05 PM UTC

Nice suggestion veena!

Translate
VeenaVikraman
New Participant
Aug 3, 2018 10:46 AM UTC

I think you should save the text using hex code for ® symbol. It will be ® .

Translate
arunpatidar
New Participant
Aug 3, 2018 10:03 AM UTC

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(®)?'))

]

Translate
Arun Patidar
Level 3
Feb 2, 2021 9:47 AM UTC

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?

 

 

Translate