[librecat-dev] cql query to get users by department

Jonathan NORRIS jnorris at ist.ac.at
Mon Mar 12 12:30:04 CET 2018


I haven't been able to find an example of this in the source code. 
Basically I just want to query for all users of a particular department. 
My attempt here is not working:

get '/groups/:group' => sub {

     my $group_name = params->{group};

     my %search_params = (cql => ["department=$group_name"]);

     my $users = LibreCat->searcher->search('user', \%search_params);

     template 'groups/group', {
       group_name => $group_name,
       users => $users

My user looks like this:

_id: A0E86400-1266-11E8-9236-8266539212D2
account_status: active
date_created: 2018-02-15T15:41:03Z
date_updated: 2018-03-12T09:20:08Z
- _id: NiBa
email: james.wallace at ist.ac.at
first_name: James
full_name: James Wallace
last_name: Wallace

But when I run the query with 'NiBa' as the group name then I get no 
results. Is my syntax or cql query correct?


Jonathan Norris

IST Austria

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20180312/d55ab0a5/attachment.html>

More information about the librecat-dev mailing list