Here is a quick patch to the search.module and node.module That allows for site search to be limited by taxonomy.

Taxonomy limited searches would be available via a URL like:

1) http://my.site.com/search/node/taxonomy/term/1+5+6/my+search+text
2) http://my.site.com/search/node/taxonomy/term/1,5,6/my+search+text

These two searches would return respectivly:
1) nodes matching "my search text" in taxonomies 1 or 5 or 6
2) nodes matching "my search text" in taxonomies 1 and 5 and 6

This functionality will not interfere with the current search syntax http://my.site.com/search/node/my+search+text. which will continue to return all nodes that match the text "my search here".

The patches are for Drupal version 4.6. If the community likes this functionality, I would like to commit it to CVS

CommentFileSizeAuthor
search_by_taxonomy_patches.zip3.09 KBjsaints
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jsaints’s picture

Forgot to mention that these patches are for Drupal version 4.6.3

Steven’s picture

Status: Needs review » Closed (won't fix)

This patch hardcodes do_search() into the node system and is thus unacceptable. The Advanced Search Features patch contains a much cleaner approach for this.

jsaints’s picture

Version: 4.6.0 » 4.6.3

If I am not mistaken do_search is by default coded into the node system. Take a look at node.module from a fresh download at around line 567 in version 4.6.3. The do_search() is there in node.module. This is not something that I coded.

Could you please explain a little further why this patch is unacceptable? I would like to know so that my future patches might be more "acceptable"

moshe weitzman’s picture

steven is comparing your patch to one he has submitted against HEAD - http://drupal.org/node/28159. his is more modular (i.e. less hard code). if you can ijprove upon his, that is preferable.