I have configured Lucene API successfully on my local machine and it works great. When I upload the code and settings to my dev machine, however, it crashes. I have tried to download database and code to replicate the environments (both running Ubuntu 9.10, Apache 2.2.12, PHP 5.2.10-2ubuntu6.4) but then it works locally. Removing the directory sites/default/files/luceneapi_node just recreates it at next page load but the problem remains on the dev machine.
The problem is that it doesn't index anything "Index overview" at the "Index statistics" page says:
100% of the content has been indexed.
Number of documents in index: 0
Number of terms: 0
Number of fields: 0I also get these error messages at the "Index statistics" page:
Warning: array_fill() [<a href='function.array-fill'>function.array-fill</a>]: Number of elements must be positive in luceneapi_admin_settings_statistics_form() (line 457 of /srv/www/project/sites/all/modules/luceneapi/luceneapi.admin.inc).
Warning: array_combine() expects parameter 2 to be array, boolean given in luceneapi_admin_settings_statistics_form() (line 457 of /srv/www/project/sites/all/modules/luceneapi/luceneapi.admin.inc).
Warning: Invalid argument supplied for foreach() in luceneapi_admin_settings_statistics_form() (line 523 of /srv/www/project/sites/all/modules/luceneapi/luceneapi.admin.inc).The files have the right permissions and are owned by the correct user (www-data):
tobias@kollegorna-dev:/srv/www/project/sites/default/files/luceneapi_node$ ls -la
total 20
drwxrwxr-x 2 www-data www-data 4096 2010-07-02 14:42 .
drwxr-xr-x 4 www-data www-data 4096 2010-07-02 14:42 ..
-rw-rw-r-- 1 www-data www-data 14 2010-07-02 14:42 .htaccess
-rw-rw-r-- 1 www-data www-data 0 2010-07-02 14:48 read.lock.file
-rw-rw-r-- 1 www-data www-data 20 2010-07-02 14:42 segments_1
-rw-rw-r-- 1 www-data www-data 20 2010-07-02 14:42 segments.gen
-rw-rw-r-- 1 www-data www-data 0 2010-07-02 14:42 write.lock.file
I tried var_dumping the results of luceneapi_index_fields_get($index, TRUE) at line 457 in luceneapi.admin.inc and got only an empty array. The same test locally yielded a proper list of fields.
What could be wrong? How can I move forward in debugging this? I'm thankful for any help moving forward.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | lucene-error.png | 30.15 KB | schildi |
| #5 | lucene-modules.png | 43.09 KB | schildi |
Comments
Comment #1
cpliakas commentedHi tobiassjosten.
I am changing to a support request for now, but please change back if you feel there is something else going on. As a rule of thumb, the search index should be treated as cached data, and it is best practice not to try to port it from one environment to another. Whenever you are switching environments, delete the index via the "Index statistics" page and re-index the site. This will make sure that the database and index files are in sync on the environment they are installed on. Although Search Lucene API stores it's indexes in files, there is metadata in the database that can have stale information when it is ported between environments.
Thanks,
Chris
Comment #2
tobiassjosten commentedHi Chris!
Initially I only uploaded the module files and its settings in a feature (Drupal variables with Strongarm), so neither the files nor the database were "contaminated" from my local environment. I have also tried the "Re-index", "Wipe index" and "Clear search results cache" buttons but the problem remains. Disabling, uninstalling and re-enabling the modules didn't work either.
What else could I try to solve or get more information on this problem?
Thank you for taking time to help me with this!
Comment #3
schildi commentedI can confirm the description. My site was using lucene search since a couple of months when I decided to install lucene CCK. After trying to reindex the site I got errors from cron. I could track down the problem to lucene. Wiping the whole index did not help. At last I put the whole stuff on my development machine, uninstalled all lucene modules and enabled them again. When enabling module "search lucene content" I get the messages
line number are shifted a bit because of some additional debug lines.
Lucene search now is not usable any more. Looks like a show stopper.
Some more infos:
Doing a print_r on $this in function getFieldNames (Class Zend_Search_Lucene, file Lucene.php) yields to
here you can see that _segmentInfos is empty.
Does this help any futher?
Comment #4
cpliakas commentedRegarding #3, there is a fix committed to the Search Lucene CCK module at #703226: "Both parameters should have at least 1 element" error, which has yet to be rolled into a release. Regarding #2, do you think this issue is related to Search Lucene CCK or the core module?
Thanks,
Chris
Comment #5
schildi commentedChris
I downloaded the last 1.5 version of luceneapi_cck.module form CVS. But the situation stays unchanged even when the luceneapi_cck module is completely uninstalled. Also wiping the index doesn't help (see attached screen shots). So, what can I do else?
Comment #6
cpliakas commentedschildi,
I see you are using a dev version of the Search Lucene Biblio module. Have you tried disabling that to rule it out as the cause of the problem?
schildi and tobiassjosten,
Any messages in watchdog?
Thanks,
Chris
Comment #7
schildi commentedChris
thanks for the hint. There is currently a bug for luceneapi_biblio which is told to hinder reindexing (reason: missing module date_api which was not in the list of dependencies). But I also disabled and uninstalled this module with no avail.
When the index is wiped out, there seems to be no way back. How could the index ever be established before? And what can I do else to fix the problem?
OK, the error messages come up after wiping the index. But after the first cron run they disappear, even when _biblio and _cck are installed!
So the solution seams to be - grin and ignore!
Regards
Reiner
Comment #8
cpliakas commented