I have solr 1.4 working, apachesolr search works in D7.14. I have Tika 0.9 which worked fine with D6.

As soon as I install apachesolr_attachments 7.x-1.x-dev (with apachesolr 7.x-1.x-dev) I cannot index attachments - I get this error on indexing or on testing Tika:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.apachesolr_index_entities_file' doesn't exist: SELECT * FROM {apachesolr_index_entities_file} WHERE entity_id = :entity_id; Array ( [:entity_id] => 0 ) in apachesolr_attachments_get_attachment_text() (line 74 of C:\wamp\www\sites\all\modules\apachesolr_attachments\apachesolr_attachments.index.inc).

I can see the table doesn't exist - but I cant find a way of creating it. What am I missing? It's probably obvious!

Thanks.

Phil

Comments

nick_vh’s picture

I would suggest you uninstall it completely and re-install it. Seems something went wrong when installing your schema?

PhilTheDoc’s picture

No nothing went wrong. I've had beta 19 working but I deprecated that to beta 13 to try and use apachesolr_attachments 7.x-1.0 but that didn't work - no errors, just no indexing of file content. (It all worked fine in Drupal 6). I therefore installed both the dev versions of the modules.

I'll take them right out and reinstall and see what happens. Thanks.

nick_vh’s picture

Oh, but the latest dev of attachments works fine with latest beta of apachesolr. Stick with those versions ;-)

PhilTheDoc’s picture

Thank you - I've reinstalled and I now have beta-19, attachments dev and the error has gone and the table exists.

However, the table is empty. Despite everything looking like it's working, no attachments are being indexed. Testing Tika says it can extract text. I've ticked the "Files" box in the content type list, deleted the index and reindexed everything. Content is indexed; attached files are not. Solr is working fine. the Schema is Drupal 3.0-beta-16. Solr is 1.4 - is this a problem?

Any help appreciated - maybe I should start a new thread?

Phil

nick_vh’s picture

Are you using Filefields or any other module?

Please describe your setup in a more detailed way, we'll try to get you through this!

PhilTheDoc’s picture

Thanks. This may be too much info, but here goes. My setup:
Server: WinXP 32 bit fully patched and exclusively used for this intranet site.
Drupal 7.14
Modules: acl, apachesolr, apachesolr_attachments, auto_nodetitle, autologout, backup_migrate, backup_migrate_files, calendar, cck, chain_menu_access, ckeditor, colorbox, css_injector, ctools, date, entity, eva, feeds, field_slideshow, filefield_paths, forum_access, fusion_accelerator, imce, job_scheduler, ldap, libraries, nodereference_url, noreqnewpass, panels, pathauto, pmgrowl, pngbehave, popup, print, privatemsg, references, superfish, tac_lite, token, token_custom, token_filter, views, weblinks.

All modules are up to date.

Theme - Acquia Marina 7.x-2.0-beta1

WAMP server - Apache 2.2.21, php 5.3.8, MySQL 5.5.16
Tomcat 6, Solr 3.4 (not 1.4 as I said before - sorry!)
schema drupal-3.0-beta16
Tika 0.9 (I compiled it myself - same one as was working fine in D6)

All the files I want to index are in the private files folder /sites/default/files with a number of subfolders. They are all file field attachments and the site is an upgrade from a D6 site so all the fields were converted from D6 filefields to D7 core fields.

The latest log entry related to apachesolr_attachments is:

Type Apache Solr Attachments
Date Wednesday, 30 May, 2012 - 10:15
User admin
Location http://lodgenet/admin/config/search/apachesolr/settings/solr/index/reset...
Referrer http://lodgenet/admin/config/search/apachesolr/settings/solr/index/reset...
Message EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7539 of C:\wamp\www\includes\common.inc).
Severity error
Hostname 172.22.255.42
Operations

The "Test Tika" function reports text is extractible. The connection to Solr is working and all nodes are indexed and the search works.

Thanks for your input - I really appreciate it.

Phil

PhilTheDoc’s picture

Surprisingly, I added a piece of content today and attached a MS Word document (.doc) and it appears to have been indexed. I've found it by searching for a word that is only in that document.

So it appears I cannot index documents previously attached, before I installed the apachesolr modules?

nick_vh’s picture

Maybe the migration went bad? You should check the differences between old file nodes and new ones?

This could be a bug in the module because I have never tested upgrade paths things

PhilTheDoc’s picture

I'm not familiar enough with the Drupal database to know what I would be looking for. As far as the website goes, all the content types, nodes and files that were there in D6 are there in D7. They are all accessible with no errors. I have a problem with filefield_paths, but that's not relevant to old data, just when I add new stuff it doesn't get a nice path. Otherwise I'm not seeing any differences at all.

Are there any dependencies in the data that affect the extraction of files for submission to Apache Solr? It seems my system will index files if it gets them submitted. It would appear the old files are not being submitted for indexing.

PhilTheDoc’s picture

Update - I edited a node with a file attachment and saved it unchanged. It appeared in the apachesolr_index_entities_file table, with "null" in the text column. I ran Cron, and got the following error:

Notice: Undefined index: path in ApacheSolrDocument->__get() (line 304 of C:\wamp\www\sites\all\modules\apachesolr\Apache_Solr_Document.php).

The error appeared twice.

Now the file in question has been indexed.

Is this something to do with paths? That's an area I keep getting an "undefined index" error - e.g. when saving a node with a file field attached. Maybe this isn't an apachesolr_attachments error at all?

PhilTheDoc’s picture

OK I've done some research and I'm confused. Opening and saving a node with a file attachment (no editing at all) results in 2 things - the file appears in the table apachesolr_index_entities_file and has it's text extracted pretty quickly, and the document description disappears (it was present to view, but did not appear when the node was edited. On saving, it is cleared). Then after a Cron run Solr has put the extracted text into the index and I can find it by searching. I sometimes, but not always, get the path error as per #10.

Apart from the document description there are no differences in any other tables before and after editing and saving the node.

So I have one option to correct this error - open and edit every node by hand. well I've done 3. Only 1900 or so to go...

I think I need a different solution!

nick_vh’s picture

You can downloads views bulk operations and save 100 or 200, heck even 3000 nodes using 1 click? I'll investigate the upgrade path asap, but this might be your best bet for now

PhilTheDoc’s picture

I'm back from holiday and this is still a real problem. I have uninstalled apachesolr search and attachments, upgraded my setup to Solr 3.6, Tika 1.1, and installed the latest dev of Apachesolr_search and 7.x-1.1-beta1 of apachesolr_attachments. Indexing still does not create entries in the files table - to get them there I have to re-save the node with the attachment and it is then in the files table. Indexing or running Cron results in the same error as I listed in #10:

Notice: Undefined index: path in ApacheSolrDocument->__get() (line 304 of C:\wamp\www\sites\all\modules\apachesolr\Apache_Solr_Document.php).

If I use VBO to re-save a couple of hundred nodes with attachments I get the error a couple of hundred times.

Apachesolr_search works just fine - no errors. It's only when I try to use apachesolr_attachments that these 2 errors occur.

I'd really appreciate a fix for this.

Thanks.

Phil

nick_vh’s picture

Can you try with the latest dev version? Loads of things have been fixed.

Notice: Undefined index: path in ApacheSolrDocument->__get() (line 304 of C:\wamp\www\sites\all\modules\apachesolr\Apache_Solr_Document.php).

This error is because your solr instance is not reachable

nick_vh’s picture

Status: Active » Closed (cannot reproduce)

Closing this because the issue is far from specific enough. If you feel that this was not the case, please re-open and clarify your problem

PhilTheDoc’s picture

Sorry but I do need to reopen this - it's driving me crazy! I'll ty to be as clear and specific as possible. My setup is described in #6 and updated as in #13.

I've uninstalled apachesolr search integration and apachesolr_attachments again and reinstalled them both - dev versions as suggested. Everything works fine as far as apachesolr search integration is concerned - all nodes are indexed. however an error occurs when I try to delete the Apache solr index:

Type Apache Solr Attachments
Date Wednesday, 11 July, 2012 - 14:51
User admin
Location http://lodgenet/admin/config/search/apachesolr/settings/solr/index/delete
Referrer http://lodgenet/admin/config/search/apachesolr/settings/solr/index/delete
Message EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7539 of C:\wamp\www\includes\common.inc).
Severity error
Hostname 172.22.255.42

As far as attachments go, they will not index. The table "apachesolr_index_entities_file" is created on installation of the apachesolr_attachments module but is empty. Whether or not I tick "files" in the apachesolr search setup makes no difference - attachments do not index and the table remains empty.

If I edit and save a node with an attachment the attachment appears in the "apachesolr_index_entities_file" table, and text is extracted. then when the attachment is submitted for indexing the following error appears twice:

Type php
Date Wednesday, 11 July, 2012 - 14:58
User Anonymous (not verified)
Location http://lodgenet/batch?render=overlay&id=236&op=do
Referrer http://lodgenet/batch?op=start&id=236&render=overlay
Message Notice: Undefined index: path in ApacheSolrDocument->__get() (line 304 of C:\wamp\www\sites\all\modules\apachesolr\Apache_Solr_Document.php).
Severity notice
Hostname 172.22.255.42

You commented that this is something to do with not being able to contact the Solr instance. However Solr is contacted, the file submitted and indexed in the normal way. Text extraction works fine and searches are then satisfactory.

If I use Views Bulk Operations to resave nodes with attachments I get the "line 304" error twice for every node saved but they eventually get indexed - unless I resave all 219 attachments in one go, when I get a horrible PDOexception error. (30 at a time are OK).

So in summary I have 2 problems: (1) - apachesolr and apachesolr_attachments will not spontaneously process any attachments without their parent nodes being resaved, and (2) - submitting attachments to Solr results in 2 occurrences of a php error.

Any possibility of sorting this out will save what little hair I have left! Thanks again.

Phil

PhilTheDoc’s picture

Status: Closed (cannot reproduce) » Active
robbertnl’s picture

Any progress on this? Same issue here

nick_vh’s picture

Status: Active » Postponed (maintainer needs more info)

The best I can do to help you here is if you list all the modules that you are using that could possibly affect the indexing process.

I really cannot reproduce this, so please give us more structured information.

The undefined path should be resolved in the latest rc of apachesolr, but that does not resolve the 'not indexing' problem.

mscalone’s picture

Same issue! not indexing files of nodes already saved.

If you delete the index and/or mark all to reindex (drush solr-mark-all) after reindex (drush solr-index) files are not indexed. But after edit and save the node they are indexed.

Solr Specification Version: 3.6.1.2012.07.17.12.45.52
Drupal version 7.15
Apache Solr framework 7.x-1.0-rc5
Apache Solr Multisite Search 7.x-1.0
Apache Solr search attachments 7.x-1.2

nick_vh’s picture

Could this be the status callback? Anyone up to some debugging?

jenlampton’s picture

juagarc4’s picture

juagarc4’s picture

pwolanin’s picture

can we close as duplicate / fixed now? See the related issue