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
Comment | File | Size | Author |
---|---|---|---|
search_by_taxonomy_patches.zip | 3.09 KB | jsaints |
Comments
Comment #1
jsaints CreditAttribution: jsaints commentedForgot to mention that these patches are for Drupal version 4.6.3
Comment #2
Steven CreditAttribution: Steven commentedThis patch hardcodes do_search() into the node system and is thus unacceptable. The Advanced Search Features patch contains a much cleaner approach for this.
Comment #3
jsaints CreditAttribution: jsaints commentedIf 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"
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedsteven 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.