Greetings! I just re-indexed my site with around 50k nodes and set my search_cron_limit value to 500. The behavior was a bit strange, it seemed to do more than 500 at the beginning and I had to run cron.php several times to index the last 100 nodes. Almost as if the value of search_cron_limit was a percentage of the total node count not a whole number.
I did some brief digging to see if I could locate the source, but haven't found anything yet. If anyone has more experience with the search indexing, it might be worth looking at.
Drupal 5.5, PHP 3.3, MySQL 5.0
Thanks!!
Kevin
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | node.search-update-20080729.patch | 1.49 KB | ekes |
Comments
Comment #1
robertdouglass commentedCan anyone reproduce this?
@kevinhankens you surely meant something other than PHP 3.3?
Comment #2
ekes commentedI can report something similar I believe I have the reason too:-
The node.module
function node_update_index()pulls the nodes to index withThe ORDER BY GREATEST means NULL is preferred over a date or zero so in the case of anything not in the node_comment_statistics table gets indexed earlier thus jumping up the stored node_cron_last_nid used as $last_nid. The
IF(c.last_comment_timestamp IS NULL, 0, c.last_comment_timestampin the select part takes note of this, but not with the ORDER. Adding the IF NULL into the ORDER BY changing the line to:solved the problem for me. Hence re-indexing my site correctly.
Now I've not looked at the SQL compatibility on this (it was a site with MySQL 5.0.45), and as it's not been reported so much elsewhere I'm a little reticent to change the title and component. Nor have I had time to work through the other user of GREATEST, sorry, but... I've put a patch attached if someone with a bigger picture on this can look, I'm happy to investigate further if it's in the correct direction :-) and if the changes from D6 that change the whole way this works aren't coming back to D5 instead of course.
Comment #3
robertdouglass commentedThanks for the patch.
Comment #4
robertdouglass commentedComment #5
drummI have also seen the coalesce() SQL function used in this type of situation.
Comment #6
jhodgdon7.0 is out tomorrow, 5.x is obsolete, won't fix, sorry.