I configured a vocabulary to be indexed "hierarchically, with parent terms". On indexing (with drush) I receive the following error message:
WD php: EntityMetadataWrapperException: Unable to get the data property parent as the parent data [error]
structure is not set. in EntityStructureWrapper->getPropertyValue() (line 442 of
/var/web/drupal/d7contrib/entity/includes/entity.wrapper.inc).
EntityMetadataWrapperException: Unable to get the data property parent as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (Zeile 442 von /var/web/drupal/d7contrib/entity/includes/entity.wrapper.inc).
- When I disable the indexing with parent terms, the error goes away and indexing works as usual.
- When I choose to include "all parent terms", not just the imminent parent, PHP throws a segmentation fault and drush dumps a "core"-file/memory-dump (allowed memory for php: 512MB - fastcgi: 1GB - shouldn't be the problem here).
I'm using search_api and search_api_solr.
Any ideas? I really need parent terms to be indexed for a a browsing interface which heavily relies on facets.
Comments
Comment #1
jsacksick commentedAre you using the latest dev version ? Because this issue should be resolved ?
Comment #2
Anonymous (not verified) commentedI'm using this version of search_api:
7.x-1.x-dev - 2012-Mar-26
This is the drush output of all the search related modules I've installed:
Also, my entity bundle:
I'm happy to provide you with any kind of info you need, just tell me what you need and I'll collect it.
Comment #3
drunken monkeyCan you index normally, without drush?
Also, I vaguely recall some problems when not choosing "all parent terms" there – maybe that's the issue. The segfault should be reported as a PHP bug (or you could test whether a newer version of PHP fixes this issue, if possible), those can never be an application's fault.
Also try to ask around in the Entity API issue queue (are you using the latest version of that module?) whether the error looks familiar to someone. It's possible that the problem lies there, and not in the Search API.
Comment #4
Anonymous (not verified) commentedThanks for your reply. I worked around this problem and didn't look into it after I found a way to get the functionality I wanted using a combination of search API and Views-based Taxonomy (child/parent selection). I could therefore avoid indexing hierarchies, but still get selections based on relationships.
I think (with my limited understanding of the problem, anyways) that it is a problem happening at entity API and has nothing to do with search API in particular. Indexing fails only for a number of nodes where something fishy is going on with terms, but I didn't had the resources to investigate any further as I wasn't able to find out at which node and why exactly entity API failed to deal with relationships.
However, there seem to be a couple of known problems over at entity API which have to do with term's parent/child selections failing if terms are altered/deleted. The indexing failed on both ends btw, CLI and via search API UI.
Comment #5
gaëlgThis happens when the taxonomy field contains a tid of a term which does not exist anymore.
Comment #6
gaëlgIn
search_api/includes/callback_add_hierarchy.incReplace line 235:
if (!$v || !isset($wrapper->$property) || !$wrapper->$property->value()) {with
if (!$v || !$wrapper->value() || !isset($wrapper->$property) || !$wrapper->$property->value()) {Comment #7
Anonymous (not verified) commentedThe code changed meanwhile and I still get the same error in the latest minor version and dev version. In order to get it to work, replace the following code in the latest dev:
However, I'm not sure if this is the right way to fix this issue or if it just prevents the display of an error. I will test my index and my views.
Comment #8
Anonymous (not verified) commentedThis issue has been duplicated over here: http://drupal.org/node/1594762
There's a patch available, you might wanna give this a try.
Comment #9
legolasbo