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
Solved! Go to Solution.
Views
Replies
Total Likes
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)
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
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
Check user permissions.
Hi @Himanshu_Jain ,
I have checked user permission and he has read permission for all the contents.
Thanks,
Mahesh
I am assuming you are using SERVICE USER for this.
Thanks
Himanshu
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
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
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
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
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)
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
Views
Replies
Total Likes