If you run the latest version of search_api(currently dev, 2011-8-19), it appears that the attachment content is not indexed.
I observe the following log items:
Notice: Undefined property: SearchApiIndex::$entity_type in SearchApiAttachmentsAlterSettings->getFileFields() (line 84 of /home/test/public_html/sites/all/modules/search_api_attachments/includes/callback_attachments_settings.inc).
Notice: Undefined property: SearchApiIndex::$entity_type in SearchApiAttachmentsAlterSettings->propertyInfo() (line 61 of /home/test/public_html/sites/all/modules/search_api_attachments/includes/callback_attachments_settings.inc).
Comments
Comment #1
tomtech commentedI was able to address this by changing the 3 instances of entity_type to item_type in "includes/callback_attachments_settings.inc".
This removed the notices and seemed to make sure that the correct path was taken in code. But, my content still wasn't indexing.
After troubleshooting, I determined that the extractTika call was failing. Instead of raising an error, though, the result would just be an empty string returned to the calling function.
In my case, it failed because the file_create_url call created a URI that was not accessible by the java executable. I found two different solutions for this.
1) By replacing file_create_url with drupal_realpath, there was no http call...it just pulled the file straight from the filesystem.
2) By specifying the proxy information in /etc/java-6-openjdk/net.properties, the call completed successfully.
I'm not sure if option (1) would break anything...shouldn't all attachments be on the filesystem? Or are there cases where the file is simply a remote URI that would need to be fetched?
Also, maybe STDERR should be captured to a temp file, and if it is not empty, the error should be raised, or at least sent to watchdog().
Comment #2
tekante commentedAttached is a patch for switching the entity_type checks to item_type. There is a patch for switching to reading the file off of the filesystem in issue #1280730: Allow attachment indexing in private file system
Comment #3
jax commentedPatch above fixes undefined property notices and makes the module functional again.
Comment #4
xatoo commentedsearch_api_update_7110() indeed renames the entity_type field to item_type. The above patch is needed to make Search API attachments work with a newer version of Search API. Please commit this patch.
Comment #5
Anonymous (not verified) commentedpatch committed to dev version
Comment #6
Anonymous (not verified) commentedComment #7
rooby commentedIt's best to put it to fixed as closed (fixed) makes it drop off peoples radars somewhat.
(thanks fir the fix)
Comment #9
Anonymous (not verified) commentedI still receive this error:
Notice: Undefined property: stdClass::$attachments_field_op_bijlage_bijlage in SearchApiAttachmentsAlterSettings->alterItems() (line 36 of ..../search_api_attachments/includes/callback_attachments_settings.inc).I'm running the dev version of 2013-Oct-01 and Search API version 7.x-1.8 of 2013-Sep-01.
The field is selected in the configuration, so that can't be the problem.
Any idea?
Comment #10
izus commentedcan you please give instructions on how to reproduce the bug ?
i tried with Search API version 7.x-1.8 and last dev version of search_api_attachments but couldn't reproduce it.
Comment #11
izus commentedchanging status to fixed afer another test with last version but still can't reproduce.
please feel free to reopen if last version still buggy for you. please consider giving instructions on how to reproduce if so.