When enabling apachesolr_search and after searching with valid keyword, I am getting the following error on search result page.

Notice: Undefined property: stdClass::$nid in node_build_content() (line 1401 of modules/node/node.module).
Notice: Undefined property: stdClass::$type in _node_extract_type() (line 379 of modules/node/node.module).
Notice: Undefined property: stdClass::$nid in node_build_content() (line 1413 of modules/node/node.module).
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7844 of /Library/WebServer/Documents/drupal7/includes/common.inc).

I am using using solr 4.9.1.
After debugging, the error is because the node entity object passed to above node apis is not proper entity object.

[id] => jyks44/node/221
[entity_id] => 221
[entity_type] => node
[bundle] => post
[bundle_name] => Post
[ss_language] => und
[path] => node/221
[url] => http://localhost/drupal7/post/my-test-post
[label] => This is my test post
[tos_name] => admin
[is_uid] => 1
[ds_created] => 2015-09-13T19:34:37Z
[ds_changed] => 2015-09-13T19:34:37Z
[score] => 0.011769826
[content] =>  asdfasd adfasdf adf 1 read phime  ...
[created] => 1442172877
[changed] => 1442172877
[name] => admin
[is_comment_count] => 
[uid] => 1

I have copied the sorconfig.xml and schema.xml to the solr instance.
Not sure where did I go wrong!!

Comments

prabeen.giri created an issue. See original summary.

prabeen.giri’s picture

Issue summary: View changes
prabeen.giri’s picture

Status: Active » Closed (fixed)

After some more debugging, I had to answer this questions myself. Issue was on my end!!
I have modified the default search template and used node_view() there. Node object that's being passed to node_view() was the one provided by the solr which is not the default node entity object. Therefore I did a node_load() with the node entity id received from the solr and passed the default node entity object to node_view().