- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 11:49 PM
Hi ,
I have written below script in relationship. But it is not giving proper results. Where could be issue?
(function refineQuery(current, parent){
var trendWord=current.getValue('u_trending_word');
current.addEncodedQuery('nameLIKE' +trendWord+ '^ORdescriptionLIKE'+trendWord);
})(current, parent)
Thanks,
Tara Singh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 01:14 AM
Relation ship should be defined between two tables, where I cannot see the value from parent table to establish the relationship. I am assuming 'u_trending_word' is on parent table. Then the script should be
var trendWord= parent.u_trending_word;
current.addEncodedQuery('nameLIKE' +trendWord+ '^ORdescriptionLIKE'+trendWord);
Plz let me know if it works. If this doesn't work need more information to debug on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 11:57 PM - edited 08-17-2023 12:00 AM
Hello @Tarasingh26
It seems you are using AND OR at the same time Your encoded Query should be :-
current.addEncodedQuery('nameLIKE' +trendWord+ ^NQdescriptionLIKE'+trendWord);
Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 01:14 AM
Relation ship should be defined between two tables, where I cannot see the value from parent table to establish the relationship. I am assuming 'u_trending_word' is on parent table. Then the script should be
var trendWord= parent.u_trending_word;
current.addEncodedQuery('nameLIKE' +trendWord+ '^ORdescriptionLIKE'+trendWord);
Plz let me know if it works. If this doesn't work need more information to debug on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 02:06 AM
Thanks @Phanindra N . This is working. Really appreciate your help.