- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2017 04:37 AM
Hi Community
I have a question about building queries in knowledge query using both IR_AND_OR_QUERY and ^NQ
When building the query everything works fine except that when adding ^NQ nothing is shown.
Both parts of the query works separetly but when using the ^NQ non of them works.
The first part the "groups" and "comp" are arrays and the "available for" fields glidelists
I want to return results where the user is either member of a chosen group or the user have relation to a chosen company OR articles where both the lists are empty
var str = current.getEncodedQuery().toString();
var search2 = str.search('IR_AND_OR_QUERY');
var subStr = str.substring(search2, str.indexOf('^', search2));
current.addEncodedQuery('active=true^workflow_state=published^u_available_forLIKE' + groups + '^ORu_available_for_companiesLIKE' + comp + '^language=javascript:gs.getUser().getLanguage()^' + subStr +
'^NQactive=true^workflow_state=published^language=javascript:gs.getUser().getLanguage()^u_available_for_companiesISEMPTY^u_available_forISEMPTY^' + subStr);
So the question is, if im doing something wrong with the search somehow that i cant see myself or maybe i misses some functionality with IR_AND_OR_QUERY and ^NQ
Thanks
Simon
Solved! Go to Solution.
- Labels:
-
Scripting and Coding