Two curious things about that *mt2drupal* script:
* All the comment counts were zero.
* None of the imported articles are indexed by the search module.
The first I fixed by taking the output of this and putting it into a CSV file:
SELECT COUNT(nid) as count, nid FROM comments GROUP BY nid;
In BBEdit I took that file and turned a line like this:
40, 1145
Into this:
REPLACE INTO node_comment_statistics SET comment_count=40, nid=1145;
Ran the file and all the counts were updated. The code for *mt2drupal* could use a bugfix for that one.
(I'm sure, in hindsight, someone could re-write that with sub-selects but I've used MySQL so long I've stop thinking about things like that.)
The search bug I'm still hunting down. Ideas? New articles index fine but imported ones do not...
Bookmark/Search this post with:
Check the “moderate” column in the node table. By default, Drupal only indexes nodes that have moderate set to “0” (they can’t be moderated up or down, i.e. voted on). You may have set this up intentionally, or it could be that the import script set all the moderate values to “1”.
(Personally, I use moderation to allow users to move nodes to the front page by voting.)
If you want to index moderated nodes, just edit node.module around line 1521 and remove the “moderate = 0” part…
(This may not be your problem.
But it’s what my problem was a few months ago when search wasn’t indexing my posts.)
Nope, that wasn’t it. No non-zero values there.
Hmmm. I’ll bet you’ve done this, but have you tried to wipe out the entire index and have it recreated? Maybe for some reason the imported posts weren’t indexed during the first indexing cron run, and they now will never be (as indexing works on a “posted since last cron run” basis. It has nothing to do with whether a post was indexed already or not. Just on if it was posted recently.)
http://drupal.org/node/4282
Otherwise, I dunno.
I’d removed the cron timestamp values, but I didn’t know (as noted in the comments there) that it was length-sensitive. Changed that and it re-indexed. Excellent. Thanks.
Now I have another problem. The import script didn’t give subject-less comments a subject, so I have unclickable results. Yay, another thing to fix.
Oh well, at least the next guy will have the answers.
glad it worked. I got bit by the same problem before.
As for problem number 2, definitely a bug in the import script. I figure the only way to fix it would be to manually do it via MySQL or write your own script to take the first 30 letters in the comment and make it the subject. That’s what Drupal does by default (see this subject)
well actually, it’s 29 characters, but hey
that’s one thing I hate about drupal. I always accidentally post the replies in the main form instead of to the specific comment. arrgghh.