AEM fulltext search query which return exact match result only | Community
Skip to main content
Level 2
July 10, 2024
Solved

AEM fulltext search query which return exact match result only

  • July 10, 2024
  • 3 replies
  • 1580 views

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" ?

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Anil_Chennapragada

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-boosting-and-similarity-7a30cbf35dfd

 

Thanks,

Anil.

3 replies

Anil_ChennapragadaAccepted solution
Level 4
July 10, 2024

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-boosting-and-similarity-7a30cbf35dfd

 

Thanks,

Anil.

pulkitvashisth
Community Advisor
Community Advisor
July 10, 2024

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.

July 11, 2024

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.