Skip to content

simplify package search index #8395

@wardi

Description

@wardi

CKAN version

master

Describe the bug

  • SynchronousSearchPlugin is the last of CKAN's "system plugins" — plugins that aren't actually plugins (they are always loaded and various parts of core depend on them)
  • Package indexing is implemented using the IDomainObjectModification interface, a very low level DB interface. It catches modifications to many DB models and in the case of Packages, calls the package_show action and hands the returned data off to be indexed.

This is complicated, obscure and inelegant because it uses a low-level database hook to jump up to the logic layer to get a dict version of a package, when that data is already available in the logic layer.

There's also a special case in the implementation of IDomainObjectModification notifications that swallows all exceptions other than SearchIndexErrors, making indexing difficult to debug.

Steps to reproduce

Try to trace debug package indexing, have a bad time

Expected behavior

There shouldn't be any plugins that aren't plugins. Package indexing should be simple.

Additional details

If we index packages from the logic layer before committing we can reuse package data that we've already generated as our response data for faster response times.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions