AEM SQL query issue | Community
Skip to main content
April 13, 2023
Solved

AEM SQL query issue

  • April 13, 2023
  • 1 reply
  • 940 views

Hello,

I want to search the nodes on 2 different paths. For example -> /content/AA and /content/BB. The below query works fine

 

SELECT p.* FROM [cq:PageContent] AS p WHERE ( ISDESCENDANTNODE(p,[/content/AA]) OR ISDESCENDANTNODE(p,[/content/BB]) ) AND ( CONTAINS(p.[cq:tags], ‘”testAA”) )

 

but throws the below exception in the logs

 

"org.apache.jackrabbit.oak.query.QueryImpl Fulltext query without index for filter Filter"

 

Adobe document suggests to improve the query if we get the above exception.

 

What is the best way to form a query to search in 2 different paths ? Any suggestions.

 

Thanks !!

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 SivakumarKanoori

@srajput-woolies SELECT p.* FROM [cq:PageContent] AS p WHERE ( ISDESCENDANTNODE(p,[/content/AA]) OR ISDESCENDANTNODE(p,[/content/BB]) ) , Till this level there will be no issues. 

 

Once you added contains to the query which is treating as fulltext query and showing that in the log. May be you need to relook at the index which you have in place already.

1 reply

SivakumarKanoori
Community Advisor
Community Advisor
April 13, 2023

@srajput-woolies :

Do you have property and fulltext indexes in your aem already, if not you need to create.

In your query you have used contains and checking against one property/ so it treats as full text query,. 

SELECT p.* FROM [cq:PageContent] AS p WHERE ( ISDESCENDANTNODE(p,[/content/AA]) OR ISDESCENDANTNODE(p,[/content/BB]) ) AND ( CONTAINS(p.[cq:tags], ‘”testAA”) )

 

Make sure that , you have created the fullest and property indexes properly . So that you will get the results quickly without traversing through several nodes.

you can check below blogs.

 

http://www.aemcq5tutorials.com/tutorials/aem-oak-indexing-comprehensive-guide/

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/operations/removal-generic-lucene-index.html?lang=en

Thanks,Siva
April 13, 2023

Thanks for the response.

 

We already has index for this query, which search only at one path -

 

SELECT p.* FROM [cq:PageContent] AS p WHERE ISDESCENDANTNODE(p,[/content/AA])  AND ( CONTAINS(p.[cq:tags], ‘”testAA”) )

 

But due to one of the requirement, we have to search at 2 paths now, hence we updated our query, which looks as below (ISDESCENDANTNODE with OR) 

SELECT p.* FROM [cq:PageContent] AS p WHERE ( ISDESCENDANTNODE(p,[/content/AA]) OR ISDESCENDANTNODE(p,[/content/BB]) ) AND ( CONTAINS(p.[cq:tags], ‘”testAA”) )

 

After the Query update, we get the Index exception as warning in logs.

 

Thanks!! 

SivakumarKanoori
Community Advisor
SivakumarKanooriCommunity AdvisorAccepted solution
Community Advisor
April 13, 2023

@srajput-woolies SELECT p.* FROM [cq:PageContent] AS p WHERE ( ISDESCENDANTNODE(p,[/content/AA]) OR ISDESCENDANTNODE(p,[/content/BB]) ) , Till this level there will be no issues. 

 

Once you added contains to the query which is treating as fulltext query and showing that in the log. May be you need to relook at the index which you have in place already.

Thanks,Siva