I know this isn't going to work, but hopefully you get what I'm trying to do. Do I need to do something with IQuery? I can't find any code examples on how to deal with spreading the generation of the query across more than one fluent "one liner".
foreach(string role in Roles.GetRolesForUser()) { query = query.Or().GroupedAnd(new string[] { "IsProtected", "AccessRoles" }, new string[] { "true", role }); }
Then, finally, do the search, e.g:
var results = searcher.Search(query.Compile());
In case this helps someone else... Or me if I forget this in another 6 months... :-)
Examine Search Confusion
I have this code snippet that is working fine:
But I need to dynamically add more than one GroupedAnd method outside of the fluent "one liner". I.e:
I know this isn't going to work, but hopefully you get what I'm trying to do. Do I need to do something with IQuery? I can't find any code examples on how to deal with spreading the generation of the query across more than one fluent "one liner".
Solved it. Turns out I needed to use the IBooleanOperation type to build the query, e.g:
Then append to that query, e.g:
Then, finally, do the search, e.g:
In case this helps someone else... Or me if I forget this in another 6 months... :-)
is working on a reply...