<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Thank you for your help. Will adding this overwrite the original
index data in store.yml?<br>
</p>
<br>
<div class="moz-cite-prefix">On 03/12/2018 04:15 PM, Patrick
Hochstenbach wrote:<br>
</div>
<blockquote type="cite"
cite="mid:EDF01BF7-2DD7-4557-B30F-6249BBA08669@ugent.be">
<pre wrap="">Please find in the attachment a correct configuration file
BR
Patrick
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">On 12 Mar 2018, at 16:06, Patrick Hochstenbach <a class="moz-txt-link-rfc2396E" href="mailto:Patrick.Hochstenbach@UGent.be"><Patrick.Hochstenbach@UGent.be></a> wrote:
Hello
The ‘department’ index is not defined in the default configuration files for user queries.
You need to add it in your layer in a new configuration file (e.g. myindexes.yml) with content:
store:
search:
options:
bags:
user:
cql_mapping:
indexes:
department:
op:
'all': true
'any': true
'=': true
'exact': {field: 'department.name.exact'}
field: ['department._id', 'department.name’]
Then reindex your data ‘./index.sh’ index.
Now you can find all the users with a affiliation:
$ bin/librecat user list 'department = 9999’
Or as you wrote in your Perl code
Best regards
Patrick
</pre>
<blockquote type="cite">
<pre wrap="">On 12 Mar 2018, at 12:30, Jonathan NORRIS <a class="moz-txt-link-rfc2396E" href="mailto:jnorris@ist.ac.at"><jnorris@ist.ac.at></a> wrote:
Hello,
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
department:
- _id: NiBa
email: <a class="moz-txt-link-abbreviated" href="mailto:james.wallace@ist.ac.at">james.wallace@ist.ac.at</a>
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?
Thanks,
Jonathan Norris
IST Austria
_______________________________________________
librecat-dev mailing list
- send list mails to <a class="moz-txt-link-abbreviated" href="mailto:librecat-dev@lists.uni-bielefeld.de">librecat-dev@lists.uni-bielefeld.de</a>
- to unsubscribe or change options, visit <a class="moz-txt-link-freetext" href="https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev">https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev</a>
- project website: <a class="moz-txt-link-freetext" href="http://librecat.org/">http://librecat.org/</a>
</pre>
</blockquote>
<pre wrap="">
_______________________________________________
librecat-dev mailing list
- send list mails to <a class="moz-txt-link-abbreviated" href="mailto:librecat-dev@lists.uni-bielefeld.de">librecat-dev@lists.uni-bielefeld.de</a>
- to unsubscribe or change options, visit <a class="moz-txt-link-freetext" href="https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev">https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev</a>
- project website: <a class="moz-txt-link-freetext" href="http://librecat.org/">http://librecat.org/</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<br>
</body>
</html>