Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

fulltext in query doesn't work for partial search term

Avatar

Avatar
Validate 1
Level 2
salamswapnil
Level 2

Likes

6 likes

Total Posts

16 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Give Back
Ignite 1
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 2
salamswapnil
Level 2

Likes

6 likes

Total Posts

16 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Give Back
Ignite 1
Boost 5
Boost 3
View profile
salamswapnil
Level 2

22-03-2021

Hello 

We are not getting results for partial keywords search by query.

e.g.

It doesn't return results for below query

type=cq:Page
path=/content/mysite/us/en/resources
fulltext=Ind
 
But it gives results for below one.
type=cq:Page
path=/content/mysite/us/en/resources
fulltext=India
 
Is this an expected behavior or am I missing anything here?
 
Thanks
Swapnil

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
salamswapnil
Level 2

Likes

6 likes

Total Posts

16 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Give Back
Ignite 1
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 2
salamswapnil
Level 2

Likes

6 likes

Total Posts

16 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Give Back
Ignite 1
Boost 5
Boost 3
View profile
salamswapnil
Level 2

05-04-2021

Thank you everyone for your responses. We are able to achieve expected behavior (partial keyword search) by appending '*' in the fulltext term.

e.g. Below query gives all the results having text "Ind[xxxxx]". This is similar to wildcard character search in lucene.

type=cq:Page
path=/content/mysite/us/en/resources
fulltext=Ind*
 
PS : It comes with slight performance overhead. 

Answers (3)

Answers (3)

Avatar

Avatar
Seeker
Level 2
Rajalakshmi
Level 2

Likes

9 likes

Total Posts

15 posts

Correct Reply

0 solutions
Top badges earned
Seeker
Give Back 3
Give Back
Engage 1
Boost 5
View profile

Avatar
Seeker
Level 2
Rajalakshmi
Level 2

Likes

9 likes

Total Posts

15 posts

Correct Reply

0 solutions
Top badges earned
Seeker
Give Back 3
Give Back
Engage 1
Boost 5
View profile
Rajalakshmi
Level 2

22-03-2021

Hi @salamswapnil, full-text field searches for the whole word that matches the search key anywhere in webpages.

If your search key is "Ind" then it searches for Ind everywhere on pages

FYR => tothenew.com/blog/full-text-search-in-aem-using-query-builder/

 

 

 

Avatar

Avatar
Springboard
Level 4
bilal_ahmad
Level 4

Likes

66 likes

Total Posts

108 posts

Correct Reply

16 solutions
Top badges earned
Springboard
Validate 10
Validate 1
Ignite 1
Establish
View profile

Avatar
Springboard
Level 4
bilal_ahmad
Level 4

Likes

66 likes

Total Posts

108 posts

Correct Reply

16 solutions
Top badges earned
Springboard
Validate 10
Validate 1
Ignite 1
Establish
View profile
bilal_ahmad
Level 4

22-03-2021

Hey @salamswapnil

 

The results you are getting are just right, as you're making use of fulltext search. You can create synonyms(a text file) and then based on your search text(like Ind = you'd expect to fetch it the result for India). Nicely explained by @Albin_Issac on his blog: https://medium.com/tech-learnings/how-to-enable-search-synonyms-in-aem-with-lucene-ccb780375eb4 

 

Hope this would help!

 

Thanks,

Bilal.

Avatar

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

551 likes

Total Posts

663 posts

Correct Reply

191 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

551 likes

Total Posts

663 posts

Correct Reply

191 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile
asutosh_jena
Level 10

22-03-2021

Hi @salamswapnil 

The term "full-text" itself contains the answer. Whenever we use a full-text search as the predicate, AEM will internally try to look for any occurances where it can find the exact search text as a whole word.


It's exactly works in the same way as SQL2 below:
SELECT * FROM [nt:unstructured] WHERE ISDESCENDANTNODE('/jcr:root/content/mysite/us/en/resources') AND LOWER([prop]) LIKE "%Ind%" ORDER BY [cq:lastModified] desc


As you mentioned you are correct and it will always return the full text result if found any.

Hope this helps!
Thanks!