[Girder-users] Querying by metadata

Andrés Fortier andres at ekumenlabs.com
Thu Jun 29 11:22:26 EDT 2017


Hi Zach,
thanks for the quick reply. What you say makes as lot of sense, my next
question on this was going to be about performance and indexes for this
kind of search :).

Just to clarify, if we go this road, is there a way to query all
collections at once or we need to run the query for each collection? I'm
asking because we may need to create collections on the fly as the system
runs, so it would be great to be able to query all elements regardless of
the collection they belong to.

Thanks again,
Andy

On Thu, Jun 29, 2017 at 11:48 AM, Zach Mullen <zach.mullen at kitware.com>
wrote:

> 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/86d31790/attachment.html>


More information about the Girder-users mailing list