[ckan-changes] [ckan/ckan] d47265: [#1792] Fix bug with fields with more than 5000 va...

GitHub noreply at github.com
Mon Jun 30 23:33:16 UTC 2014

  Branch: refs/heads/1792-filterable-resource-views
  Home:   https://github.com/ckan/ckan
  Commit: d47265ea1966f555cbc6e940d2e65fec7826aa7d
  Author: Vitor Baptista <vitor at vitorbaptista.com>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M ckan/lib/helpers.py
    M ckan/public/base/javascript/modules/resource-view-filters.js
    M ckan/templates/package/snippets/resource_view_filters.html

  Log Message:
  [#1792] Fix bug with fields with more than 5000 values

Before, we tried to load 5000 values for every resource. If the resource had
more records than that, we simply ignored it. This meant the user couldn't add
filters to it anymore.

Now, instead of pre-loading the values, we simply get the field list and use
select2 to search the datastore when the user tries to add a filter. This means
that we now can handle resources of any size.

There're a few problems because `datastore_search` doesn't support returning
only DISTINCT values, so we have to do this on the client. It also messes with
the results in other ways. I created an issue #1815 to add this feature. When
that's done, we can improve this code.

More information about the ckan-changes mailing list