We currently hard-code a limited set of search operands ('category', 'type') in node.module. This approach makes it very difficult to implement additional operands in a contrib module.

Not impossible: I recently implemented locational search operands (lon, lat, city, province, country, postal_code) in a contrib module extending location.module, http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/nedjo/modules.... But doing this required practically every trick in the book (form_alter, #submit, #pre_render, $validate, $_SESSION, db_rewrite_sql, etc.) and is still imperfect.

We should extend the search api so that modules can define operands. Under this approach, the 'category' operand should be defined and implemented in taxonomy.module.

Perhaps this could be done through a hook_node_search_operands().

Comments

Steven’s picture

Title: Search operands should be extsnsible and moved out of node.module » Node search operands should be extsnsible and moved out of node.module
Component: search.module » node.module

Correcting bad classification.

Still, I'm skeptical about this. This means piling an API (node_search_operands) onto an abstraction layer (node.module) onto an API (search framework + html indexer). Then people will want to fine tune which fields people can search on. SQL table joins need to be resolved, condition strings need to be built and passed around and query arguments need to be merged. That's very, very, very messy.

LAsan’s picture

Version: x.y.z » 7.x-dev

Feature request, moving to cvs.

mdupont’s picture

Status: Active » Closed (won't fix)

Closing this old issue. Nowadays this is achieved by using the Views contrib module.