[Girder-users] Querying by metadata

Zach Mullen zach.mullen at kitware.com
Thu Jun 29 10:48:11 EDT 2017


Hi Andy,

Thanks for reaching out! This is actually a common sort of use case, but
Girder out-of-the-box does not support it (yet). The main reason for that
is because these sorts of queries should typically be performed against a
database index so that they can scale up to large numbers of folders/items.
So, the recommended route for this case is to create a small plugin that
makes sure your desired search field is indexed. To achieve that, you'd add
a line like:

    ModelImporter.model('item').ensureIndex(['meta.type', {'sparse': True}])

Then, you'd want to probably add a small API endpoint to search by this
field, and perhaps even some UI augmentation to expose it somewhere. Let me
know if you need help with those other steps.

Thanks,

Zach Mullen
Kitware, Inc.
919-869-8858

On Thu, Jun 29, 2017 at 9:18 AM, Andrés Fortier <andres at ekumenlabs.com>
wrote:
>
> Hi all,
> first of all, sorry of this is a trivial question, just getting started
with Girder. We are currently evaluating using Girder as a backend to store
resources (either a folder or a file). One of the requirements we have is
that a resource may have 0, 1 or more "types" (although it will most likely
be 1 for a starter), which can be plain strings. Also, we want to be able
to search resources by type, even if they are in different collections.
>
> Initially we thought on attaching a type property to a resource metadata,
which could be an array of strings. However the search bar in the web
front-end doesn't seem to support search by metadata, so I was wondering:
is metadata search supported on a collection? if yes, how about
cross-collection search? If no, should I write a plugin to do that?
>
> Any hints / pointers are much appreciated.
>
> Thanks!
> Andy
>
> _______________________________________________
> Girder-users mailing list
> Girder-users at public.kitware.com
> http://public.kitware.com/mailman/listinfo/girder-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/girder-users/attachments/20170629/32013b10/attachment.html>


More information about the Girder-users mailing list