[ckan-dev] h.get_facet_items_dict and c.search_facets

Ian Ward ian at excess.org
Thu Apr 7 16:30:26 UTC 2016


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
>



More information about the ckan-dev mailing list