Hiding a certain type of item from browsing views

I am working on a plugin that stores its records as items for interoperability with other plugins, but the records risk being so numerous that they crowd out regular items. Is there a way to hide a specific type of items from browsing views (/admin/items/browse and /items/browse), but still make it available for searching or individual viewing?

The MODELs_browse_params filter looks useful, but it doesn’t document how “filtering parameters” are structured: http://omeka.readthedocs.io/en/latest/Reference/filters/<model>s_browse_params.html

The browse “params” filter is just for altering the paramters as requested by the user (or whatever the request originates from). The parameters being referred to are those that the model’s table class responds to in its applyBrowseFilters method or those respected by plugins that are using the <model>_browse_sql filter.

In other words, the parameters in that filter are the same as are used in the advanced search, browse page query string, or calls to findBy.

I take your point that the available parameters and their values aren’t listed in the documentation. I think that’s due to uncertainty as to where to put them as much as anything else.

The task sounds similar to something I was working with in an experimental MediaBuckets plugin a while ago. Its items browse sql hook might point in useful directions, at least for some of your goals.

This is a great lead, but the items_browse_sql hook was hiding items from both browsing AND searching views. I’m thinking about adding a surrogate model that synchronizes with it using the after_save_items hook, then making it searchable. Do you know about any alternatives to this approach?

I suspect that all the data for searching is present in the database, but not being displayed because of that filter on the sql.

If I remember right, the name of the hook is a little misleading in that it gets applied in other contexts, too.

So, as an alternative, it should be possible to figure out the controller and action for the request, and only apply the sql filters for specific situations.

Thank you for the tip, it looks functional so far. Right now I have this:

public function hookItemsBrowseSql($args) {
    $params = $args['params'];
    if (isset($params['controller']) && isset($params['action'])) {
        if (($params['controller'] == 'items') && ($params['action'] == 'index' || $params['action'] == 'browse') && !isset($params['search'])) {
            $select = $args['select'];
            $db = get_db();
            $itemType = $db->getTable('ItemType')->findByName('Hidden Record');
            $select->where("item_type_id != ? OR item_type_id IS NULL", $itemType->id);
        }
    }
}

Do you foresee any situations where this approach may come apart?

Edit: Corrected typo on $itemType line.