[ckan-dev] Antwort: Re: h.get_facet_items_dict and c.search_facets

Florian.Brucker at mb.karlsruhe.de Florian.Brucker at mb.karlsruhe.de
Fri Apr 8 05:30:54 UTC 2016


Ian,

I am not sure whether my use case is sufficient for any fundamental changes
-- a tag cloud is just nice to have and I'm sure there are more important
things to work on. I was hoping that I misunderstood something or that
there was a quick workaround.

Since you seem to have a bigger idea regarding this topic (i.e. removing
c.search_facets) please file a ticket yourself (I don't know much about
that part of CKAN).


Regards,
Florian


"ckan-dev" <ckan-dev-bounces at lists.okfn.org> schrieb am 07.04.2016
18:30:26:

> Von: Ian Ward <ian at excess.org>
> An: CKAN Development Discussions <ckan-dev at lists.okfn.org>,
> Datum: 07.04.2016 18:30
> Betreff: Re: [ckan-dev] h.get_facet_items_dict and c.search_facets
> Gesendet von: "ckan-dev" <ckan-dev-bounces at lists.okfn.org>
>
> We'll need to perform a search query to get the facet counts on pages
> that weren't generated from a search query. How expensive is issuing a
> query with rows=0 just to get the facet results? We could cache the
> result so that each call to get_facet_items_dict won't trigger another
> query.
>
> If possible, while we're at it I'd love to remove c.search_facets
completely.
>
> Florian: I'd be happy to discuss this on a ticket in the ideas repo,
> or if you're planning to implement this soon, on the ckan repo.
>
> On Thu, Apr 7, 2016 at 12:16 PM,  <Florian.Brucker at mb.karlsruhe.de>
wrote:
> > Hi!
> >
> > I'm trying to add a tag cloud with the most popular tags to my CKAN
theme.
> > To get the tags and their frequency I've found `h.get_facet_items` and
it
> > seems to do the job nicely. However, it only works on some pages (home,
> > group, package search) while it doesn't on others (package/read and
> > package/resource_read). The issue seems to be that `c.search_facets` is
not
> > defined on all pages, and  `h.get_facet_items` returns an empty list if
it
> > isn't.
> >
> > Is that intended behavior? If so, how can I get `h.get_facet_items` to
work
> > on these pages?
> >
> >
> > Regards,
> > Florian
> >
> >
> > _______________________________________________
> > ckan-dev mailing list
> > ckan-dev at lists.okfn.org
> > https://lists.okfn.org/mailman/listinfo/ckan-dev
> > Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
> >
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160408/4d62304d/attachment-0003.html>


More information about the ckan-dev mailing list