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

Query partially works in dev/qa environment

Avatar

Level 4

Hi All,

I have a query which gives suggestions as a result. This works fine in my local instance but works partially in dev/qa environment.

Eg. If I search "Sol" it gives me many results but if the same code is deployed to dev it doesn't gives any results. All the content and code is same but this query doesn't work properly in dev. It is a simple suggestions query where I return page title as a result.

Please help me to fix this.

 

Query:

 

SELECT [rep:suggest()] FROM [cq:Page] WHERE SUGGEST('" + q
						+ "') AND (ISDESCENDANTNODE('" + p + "'))";

 

Regards,

Mahesh 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@smahesh 

Please note that suggest queries used with ISDESCENDANTNODE has very limited support to subset the suggestions under that path. 

The subset is done by filtering top 10 suggestions. So, it's possible to get no suggestions for a subtree query, if top 10 suggestions are not part of that subtree.

 

Try the same query without ISDESCENDANTNODE  in your DEV/QA (Use Explain Query from Tools -> Diagnosis -> Query Performance)

View solution in original post

12 Replies

Avatar

Community Advisor

Is it giving any error when running this query code? or Zero results ?

Please check the logs and permissions of the user logged in to run this query

Avatar

Level 4

Hi @SureshDhulipudi ,

The query gives results for some keywords but for others it gives zero results. Also i checked the permission of user and he has read permission.

 

Thanks,

Mahesh 

Avatar

Community Advisor

Check user permissions.

Himanshu Jain

Avatar

Level 4

Hi @Himanshu_Jain ,

 

I have checked user permission and he has read permission for all the contents.

 

Thanks,

Mahesh

Avatar

Community Advisor

I am assuming you are using SERVICE USER for this.

 

Thanks

Himanshu

Himanshu Jain

Avatar

Level 4

Hi @Himanshu_Jain ,

 

Yes i am using a service user and it has all the permission.

The query gives results for some of the keyword so if it has not permission it won't work at all.

 

Thanks,

Mahesh 

Avatar

Level 4

Hi @Himanshu_Jain ,

 

Thanks for your help but that link has a different requirement with suggest query like any and or condition along with suggest query which is not in my case.

In my case the query works fine in local but don't work in dev/qa environment. It works for few keywords in dev/qa environment.

 

Thanks,

Mahesh 

Avatar

Community Advisor

Hi Makesh,

 

Given data is same in local and in qa/dev envs and permissions are fine.

 

Check what was the last successful indexing time in qa/dev env's. 

Try re-running indexing on indexes in qa/dev, see if index size changes. If there are any errors during indexing fix them and run re-indexing again. Once size of index changes run your query again.

 

Regards,

Peter 

Avatar

Level 4

Hi @Peter_Puzanovs ,

 

I did check the reindexing today morning and still it is same. I mean it didn't fix the issue at all.

 

I have logged an support ticket for this.

 

Thanks,

Mahesh 

Avatar

Correct answer by
Community Advisor

@smahesh 

Please note that suggest queries used with ISDESCENDANTNODE has very limited support to subset the suggestions under that path. 

The subset is done by filtering top 10 suggestions. So, it's possible to get no suggestions for a subtree query, if top 10 suggestions are not part of that subtree.

 

Try the same query without ISDESCENDANTNODE  in your DEV/QA (Use Explain Query from Tools -> Diagnosis -> Query Performance)

Avatar

Level 4

Hi @Vijayalakshmi_S ,

 

Even it is very less support for ISDESCENDANTNODE in suggest query it should give same result as what i am getting in local . As the contents are same so why it doesn't give results same as local in dev/qa environment?

 

Thanks,

Mahesh