I've got the module installed and the Solr server up and running, and have tried running cron both through the web browser and through the command line, but indexing doesn't seem to work. I'm not sure if the numbers under the "indexing status" section of the "Search settings" page are still relevant, but they aren't changing and searches for any terms fail.
Furthermore, after running cron through the web browser, the screen is flooded with these warnings repeatedly… (Yeah, the server is a Windows box, at the client's insistence…)
warning: Invalid argument supplied for foreach() in D:\live\sites\all\modules\cck\fieldgroup.module on line 394.
warning: Invalid argument supplied for foreach() in D:\live\modules\taxonomy\taxonomy.module on line 1329.
After disabling the Solr modules and running cron again, the warnings were not visible.
Any clues? Did I maybe miss a step in the setup process?
Does Solr respect the "Indexing throttle" value on the "Search settings" page? The number of times the error lines above were repeated seem to match the throttle value, but setting it to a lower value didn't seem to make the cron run go any faster.
Is there a way to query Solr directly (in the administration panel doodad) as to how many records it has indexed?
Comments
Comment #1
Garrett Albright commentedThis is more of a support request than a bug report… "bug report" sounds so accusatory. =]
Comment #2
robertdouglass commentedGarrett, can you upgrade to DRUPAL-5 and try that (the devel release)? Please confirm the bug with that code.
Comment #3
Garrett Albright commentedBefore I installed the dev release, I tried it again with the plain ol' beta release. This time running cron changes the "There are X items left to index" values on the "Search settings" page, but the errors still apepar, and searching on very common terms still fails to return results. Again, is there a way to query Solr to ask it how many records it thinks it has indexed?
Then I tried upgrading to the dev release… no changes.
Dumb me for not checking Watchdog before… After running cron, the first message from the module says "Adding 20 docs," and that's followed (temporally) by an error that says "'400' Status: Document_nidnull_missing_required_fields_nid_." It then alternates between messages counting up the number of items it's supposedly indexing, followed by errors saying "'0' Status: Communication Error." But I know that Solr is up and running because I can go to http://localhost:8983/solr/admin/ …
If it's not obvious, I really have no idea what I'm doing here.
Comment #4
robertdouglass commentedSearching for *:* will give you all results in the index.
Solr is very flexible in what you can send its way. It only has one required field, and that is nid. Your documents can have any other fields they want, and you can omit any of the other fields. Somewhere your site is trying to index something that doesn't have an nid, so debugging this will require a bit of sleuth work on your part.
At line 131 in apachesolr.module you'll see this:
$node = node_load($row->nid);Right after that, add this:
Then reproduce the error and inspect your watchdog messages.
Let me know what you find.
In the meantime I added a check to the latest DRUPAL-5 version that should just avoid the problem by skipping nodes that don't load.
Comment #5
Garrett Albright commentedThanks for the swift reply.
I can't imagine what it'd be wanting to load that doesn't have an nid… It should just be indexing nodes, right? And nodes have nids…
I'd love to give your code a try, but circumstances are a bit tricky… I won't go into the details, but it's a fairly popular site and I have to work on the live site (yes, I know, very bad, but as I said before, the client insists on a Windows server and we simply don't have one of our own to test off of -- I'm always very careful about backing up stuff before I start hacking), which means I have to work in the wee hours of the morning when there are usually very few visitors to the site in order to cause the fewest disruptions to visitors -- and advertisers. (I'm just about to fall asleep as it is.) And since I have to go back to working normal hours on Monday, I'm not going to want to stay up late again Sunday night… So I probably won't be able to work on this until next weekend. Maybe I'll post the results then.
Comment #6
Johnny vd Laar commenteddo you have some optional nodereference cck fields somewhere?
i enabled some nodereference cck fields inside a field group and i think this started to give me exactly the same errors as you are receiving
Comment #7
Garrett Albright commentedYes, actually, the site I was trying to index made extensive use of NodeReference fields…
Comment #8
gstead commentedI have a similar problem. Here are the key bits of information I can provide:
I am versed in Solr but less so with Drupal. I have used serialize() and print_r to examine the documents apachesolr tries to index, but don't know what the results should look like.
I would really like to try this module and would be happy to debug further, I'm just not sure where to start. I'm open to suggestions...
thanks!
-Graham
Comment #9
robertdouglass commentedComment #10
robertdouglass commentedWe obviously have to fix this before a 1.0 release.
Comment #11
pahariwalla commentedI'm taking a look at tackling this issue but have not been able re-create the error (steps described below). It appears that I'm not understanding the problem.
Using: apachesolr.module,v 1.1.2.32 2008/09/16 11:26:58 robertDouglass Exp $
note: In comment #4 you said "In the meantime I added a check to the latest DRUPAL-5 version that should just avoid the problem by skipping nodes that don't load"
could this be:
STEPS that did not re-create the error.
0) Created a few cck fields on Story content type, including a node reference field
1) Noticed that it is not listed with the other fields on admin/settings/apachesolr/index
2) Populated a number of records, referencing nodes on a few
3) Removed a couple of the referenced nodes
4) Used "Delete the Index" button and confirmation checkbox on admin/setting/apachesolr/index
5) Ran cron from Devel menu a few times to get 100% Indexed
6) Recent Log Entries shows: (no errors)
cron 09/17/2008 - 17:57 Cron run completed. admin
Apache Solr 09/17/2008 - 17:57 Adding 0 documents in cleanup admin
cron 09/17/2008 - 17:57 Cron run completed. admin
Apache Solr 09/17/2008 - 17:57 Adding 6 documents in cleanup admin
Apache Solr 09/17/2008 - 17:57 Adding 50 documents admin
cron 09/17/2008 - 17:56 Cron run completed. admin
Apache Solr 09/17/2008 - 17:56 Adding 0 documents in cleanup admin
Apache Solr 09/17/2008 - 17:56 Adding 50 documents admin
Comment #12
JacobSingh commentedCan the authors of this ticket please confirm the problem using the newest check out from the DRUPAL-5 branch?
Comment #13
Garrett Albright commentedSorry, no. We've given up and are back to using Drupal's core search system. If the client wants me to give this another try sometime, I will, but for now we're no longer trying to work with Solr.
Comment #14
pwolanin commented