Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

AEM fulltext search query which return exact match result only

Avatar

Level 2

Hi,

I have to search through site content's all the property(since any property may contain that value) and list the page path. I am using below QueryBuilder fulltext but it also return the result which partially matched.

 

path=/content/mysite/us/en
type=cq:Page
group.p.and=true
group.1_group.fulltext=/content/dam/mysite/images
p.offset=0
p.limit=10
orderby=@jcr:content/cq:lastModified
orderby.sort=desc

 

But It is also returning the page which have value as "/content/dam/mysite/images/icon" or "/content/dam/mysite/images/logo" so how get only pages which have exact match "/content/dam/mysite/images" ?

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 4

hi @rockstar234 , 

hope you have figured some solution around this. If not please consider below.

I don't think there is any OOTB way to fetch the exact match result for full text search. However, below are good articles how can you get much precise values

https://medium.com/@shubhanshu.singh/aem-fulltext-lucene-search-implementation-part-1-cd99687ff736

https://medium.com/@shubhanshu.singh/aem-lucene-search-part-2-filtering-suggestions-analyzers-boosti...

 

Thanks,

Anil.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 4

hi @rockstar234 , 

hope you have figured some solution around this. If not please consider below.

I don't think there is any OOTB way to fetch the exact match result for full text search. However, below are good articles how can you get much precise values

https://medium.com/@shubhanshu.singh/aem-fulltext-lucene-search-implementation-part-1-cd99687ff736

https://medium.com/@shubhanshu.singh/aem-lucene-search-part-2-filtering-suggestions-analyzers-boosti...

 

Thanks,

Anil.

Avatar

Community Advisor

Hi @rockstar234 
Your use case can be solved with elimination.
In the above predicate you can create 2 groups , one with fulltext search value as 
"/content/dam/mysite/images" and another group with fulltext search as "/content/dam/mysite/images/" with "not=true" . 
This way you can get the results with exact fulltext search.

Avatar

Level 1

https://github.com/paulrohrbeck/aem-links/blob/master/querybuilder_cheatsheet.md - this is the cheat sheet you can refer and try options maybe some ordering and use properties / path filtering , I hope you will get the answers from here.