Query partially works in dev/qa environment | Community
Skip to main content
Level 3
January 16, 2023
Solved

Query partially works in dev/qa environment

  • January 16, 2023
  • 4 replies
  • 3957 views

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 

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 Vijayalakshmi_S

@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)

4 replies

SureshDhulipudi
Community Advisor
Community Advisor
January 16, 2023

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

smaheshAuthor
Level 3
January 17, 2023

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 

Himanshu_Jain
Community Advisor
Community Advisor
January 17, 2023

Check user permissions.

Himanshu Jain
smaheshAuthor
Level 3
January 17, 2023

Hi @himanshu_jain ,

 

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

 

Thanks,

Mahesh

Himanshu_Jain
Community Advisor
Community Advisor
January 17, 2023

I am assuming you are using SERVICE USER for this.

 

Thanks

Himanshu

Himanshu Jain
Peter_Puzanovs
Community Advisor
Community Advisor
January 17, 2023

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 

smaheshAuthor
Level 3
January 17, 2023

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 

Vijayalakshmi_S
Vijayalakshmi_SAccepted solution
Level 10
January 21, 2023

@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)

smaheshAuthor
Level 3
January 24, 2023

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