Does not work, no option for no comments
| Project: | Instant Search |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
2 bugs for the price one.
1: If the comment module is not enabled then line 17 throws an error as there is no node_comment_statistics table in the database (or perhaps and/or statistic not being enabled).
2: This doesn't seem to work as it should. For example edit a node and:
a) Add Bananas, save and search for bananas - no result.
b) Add oranges, save and search for bananas - result, but no result for search for oranges.
I think the problem is that _node_index_node($node), see http://api.drupal.org/api/function/_node_index_node/6, does a node_load so fetches the old version and this routine is being called before the data is actually saved (or the cache cleared).
Since I have rules module I've done instant search with a rule. Not sure which is faster or if there is any differences. Rules is a bit more flexible as it allows you to only do instant update for specific types, if that's what you want. In the rule the action is custom php which contains all the code in _node_index_node excluding the node_load, followed by search_update_totals(). So same as your instant_search_exit function except for the node_cron_views_scale and node_cron_comments_scale, which I think don't apply for me as I don't have comments enabled.
