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
Comment #1
Steven commentedCorrecting 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.
Comment #2
LAsan commentedFeature request, moving to cvs.
Comment #3
mdupontClosing this old issue. Nowadays this is achieved by using the Views contrib module.