CoreSearches and ApacheSolr support with InstantSearch
muzzled - January 5, 2009 - 08:08
| Project: | Instant Search |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi, I am using apache solr as the main search, with core searches disabling content and user searches.
Under this configuration, _node_index_node is not a valid function to call, since coresearches'd patched it away from node.module.
A quick modification I did to the function instant_search_exit() to make it work under this config, instead of calling _node_index_node($update_node_index), use
// _node_index_node($update_node_index);
foreach (module_list() as $module) {
module_invoke($module, 'update_index');
}It works with solr indexing every node as it is created. Since I am a newbie in drupal, can someone verify that there is no ill effect and it doesn't break anything?
Cheers
Gary

#1
Hi Gary, the problem with your function is it will get the next few nodes that are not indexed yet when it gets to node_update_index
$result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit);
while ($node = db_fetch_object($result)) {
_node_index_node($node);
}
You're not sure then your node is one of those.