We're already struggling with the issue for several days.
As far as I understand, solr returns items that are not existing in our db already.
So, in SearchApiViewsQuery::addResults, if I do var_dump($results),
I see an array like:
array(
786 => array('id' => 786, 'score' => 1, 'fields' => array(..)),
789 => array('id' => 789 , 'score' => 1, 'fields' => array(..)), // -> There is NO such node on our website already!
790 => array('id' => 790 , 'score' => 1, 'fields' => array(..)),
792 => array('id' => 792 , 'score' => 1, 'fields' => array(..)),
793 => array('id' => 793 , 'score' => 1, 'fields' => array(..))
);
then, views tries to render fields of node=789 (which is NULL, obviously), and dies with fatal error.
"EntityMalformedException: Отсутствует связующее свойство у сущности типа node. в функции entity_extract_ids() (line 7501 in file /var/www/dev.kidmart.ru/www/includes/common.inc)."
For now, to get rid of fatal errors, I've added such code to SearchApiViewsQuery::addResults:
$nids = db_query("SELECT nid FROM {node} WHERE nid IN(:nids)", array(':nids' => array_keys($results)))->fetchAllKeyed(0,0);
/****** *********/
foreach ($results as $id => $result) {
if (empty($nids[$id])) continue;
that results in incorrect views results (like, 8 nodes instead of 10 on a page) but at least doesn't produce fatal error.
Can you give me some ideas on the proper debugging of the issue?
Thanks in advance.
Comments
Comment #2
restyler commentedAnybody home?
Comment #3
drunken monkeySome time ago, deleted entities weren't properly removed from the search servers. It's possible that the stale data you have troubles with comes from that time. To fix this, either manually remove the items from the Solr index, or click „Clear index“ on the index's status page which should also resolve the issue.
Comment #4
Fidelix commentedThis helped me. Thanks Drunken Monkey.
Comment #5
drunken monkey