Using Keyword search in encoded query - one last try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2020 10:02 AM
Hello - i posted another question and have received some good responses but am still having issues solving this problem -
I have an encoded query in a mail script -- and I need this to return records from the incident table that have the keywords "grants approval" ... so the incident has to have both words as a phrase - "grants approval".. I can get this to work to the point where it's returning records that have "grants approval" - but it's also pulling in records that just have the word "grants". When I go to the list view of the incidents and put this in the query there - it works. But when I move this into an encoded query - it doesn't. Here is what I have ..I have tried different variations of it. Can someone help? Is this possible? It seems like it should be if it's possible from the actual reporting module. Thanks in advance.
var gr = new GlideRecord("incident");
gr.addEncodedQuery('GOTO123TEXTQUERY321=grants approval');
gr.addEncodedQuery('priorityIN3,4,5^sys_created_onRELATIVEGE@hour@ago@24^assignment_group!=cf0639b6f5d84140b6baf27ba2d29cd4^ORassignment_group!=de9ae95874ce650094333bd4eb6f34db');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2020 10:17 AM
Hi,
https://codecreative.io/blog/gliderecord-full-text-search-explained/
https://snprotips.com/blog/2017/6/4/powerful-text-search-in-scripted-glide-record
This explains the behavior in detail.
Thanks,
Ashutosh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2020 10:47 AM
Hi.
Here are links which will help you.
If it helps,Please mark ✅ Correct and 👍 Helpful.
Warm Regards,
Milind

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2020 10:49 AM
Hi,
Please check this link
https://codecreative.io/blog/how-to-do-full-text-search-with-gliderecord/
If this works!! Please mark correct or helpful.
Thanks
Swapnil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2020 11:08 AM
Thanks - I've tried every combination in here and I cannot get this to work. I am facing a somewhat urgent deadline and have been trying to get this working for a while now. Do you know if, given the script below, if it is even possible to return records that contain just the phrase "grants approval" -
gr.addEncodedQuery('GOTO123TEXTQUERY321="grants approval"^priorityIN3,4,5^sys_created_onRELATIVEGE@hour@ago@24^assignment_group!=cf0639b6f5d84140b6baf27ba2d29cd4^ORassignment_group!=de9ae95874ce650094333bd4eb6f34db');
I have also tried
ar gr = new GlideRecord("incident");
gr.addEncodedQuery('GOTO123TEXTQUERY321=grants approval');
gr.addEncodedQuery('priorityIN3,4,5^sys_created_onRELATIVEGE@hour@ago@24^assignment_group!=cf0639b6f5d84140b6baf27ba2d29cd4^ORassignment_group!=de9ae95874ce650094333bd4eb6f34db');
I have also tried from the article you supplied "contains" , I have tried In_And_query.. nothing is working. Just looking for some specific help if you have any. I really appreciate it