Closed (fixed)
Project:
Search API
Version:
7.x-1.x-dev
Component:
Search pages
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 May 2011 at 23:27 UTC
Updated:
25 Jun 2011 at 20:31 UTC
I want to display a search result bock on the node page,
Just like this page "Related Books"
http://ebookee.org/A-Room-With-a-View-A-Novel-By-E-M-Forster_287754.html
how can I do it?
Comments
Comment #1
drunken monkeyIf you just want normal search results, a Views block should do the trick.
If you want to automatically display related nodes, that's the "More like this" feature which is just being worked on here: #1111852: Add a "More like this" feature.
Comment #2
eimhee commentedbut "More like this" Module doesn't compatible with drupal7
Comment #3
Shadlington commentedHe's not talking about a separate module.
Have a look at the issue that drunken monkey referenced.
In it, work is going on to implement solr's 'more like this' feature for the solr backend of search api.
Comment #4
eimhee commentedhttp://drupal.org/files/issues/1111852-search-api-more-like-this-82-D7.p...
I have update the code according to this file, but I don't know how to create a "more like this" block,
can you help me? Thank you very much.
Comment #5
drunken monkeyFirst, you'll also have to update the search_api_solr module, otherwise servers won't support the MLT feature.
Second, create a new view for the relevant search index (probably "Default node index"), add a block display with a "More like this" contextual filter and the node nid from the path as default argument and set the block to be displayed on node pages.
You'll also have to restart the Solr server and reindex your content, but that should be it.
Comment #6
eimhee commentedbut I want to direct to query database,
I am not using solr, so I don't change search_api_solr module
http://drupal.org/files/issues/1111852-search-api-solr-more-like-this-82...
can it works when query database directly?
Comment #7
drunken monkeyNo, the "More like this" feature doesn't work with database searches. This would be too complex to implement correctly.
Comment #8
drunken monkey