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

tomtech’s picture

I 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().

tekante’s picture

StatusFileSize
new1.48 KB

Attached 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

jax’s picture

Status: Active » Reviewed & tested by the community

Patch above fixes undefined property notices and makes the module functional again.

xatoo’s picture

search_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.

Anonymous’s picture

patch committed to dev version

Anonymous’s picture

Status: Reviewed & tested by the community » Closed (fixed)
rooby’s picture

Status: Closed (fixed) » Fixed

It's best to put it to fixed as closed (fixed) makes it drop off peoples radars somewhat.

(thanks fir the fix)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Closed (fixed) » Needs work

I 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?

izus’s picture

Status: Needs work » Postponed (maintainer needs more info)

can 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.

izus’s picture

Status: Postponed (maintainer needs more info) » Fixed

changing 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.