It would be very helpful to add the ability to filter by keyword search. The attached patch adds the ability to filter by keyword. To prevent the queries from being to heavy, the filter searches against the title of the current node (if one exists). It also includes the ability to only search by the first few words in node's title, to increase the number of nodes returned.
The patch controls this functionality by adding a new section, "Title Keywords," to the "Filtered Content Settings" section. There are two options:
- Match nodes with similar keywords? (which turns on or off the functionality all together)
- Number of words in title to search against: (which controls whether we should trim the number of words in the title before searching)
Hope this is useful! Please let me know if you have any questions or if there are any improvements I can make.
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| keyword_filter.patch | 7.27 KB | snyderp |
Comments
Comment #1
kristen polThanks! There is a drupal camp this weekend, so I will try to review while I'm at the camp.
Also, email me directly if you might be interested in being a co-maintainer of this module. You've already provided 2 patches with new features so maybe this would be something you would like to do.
Kristen
Comment #2
kristen polI have checked in a slightly modified version of this patch. The main difference is that I added in a check to see if there were any search results available and, if not, made the where clause:
otherwise there was an error when there were no search results returned. There is probably a more elegant solution but this works so it's fine for now.
The code will be available once the drupal cron runs.
Thanks!
Kristen