Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have the MLT block in apachesolr_search working fine.
I have the latest dev version of search_api and search_api_solr.
The options that I am seeing in views do not seem to match the description in the mlt feature request nor that of the readme.txt.
Is there any step by step instructions I can follow, or is there some step I might have unintentionally skipped?
Comments
Comment #1
micheas CreditAttribution: micheas commentedI have updated the xml file on the solr server to the latest one that includes the mlt additions to the xml.
Comment #2
drunken monkeyThe following steps should let you setup an MLT block:
- Create a view on the search index.
- Add fields (and/or choose a display mode) and filters like normal.
- Add the "Search: More like this" contextual filter.
- In its config form, under "When the filter value is NOT available" select "Provide default argument" > "Content ID from URL".
- Create a block display for the URL and let the block show on selected (or all) node pages.
- If you aren't using this with nodes, you have to get the ID of the item you are using from the URL, not the "Content ID". Unless it's a taxonomy term or user, you'll probably have to write the default argument handler yourself.
Comment #3
micheas CreditAttribution: micheas commentedMy problem was, that I was choosing "search index" and not the name that I had assigned to my search index.
Everything became clear after that.
Comment #4
micheas CreditAttribution: micheas commentedI will say that it seems a little slow. But it is working.
Comment #5
alanom CreditAttribution: alanom commentedIf this is going to be the documentation for More Like This it should probably include a link to the initial issue so we can see what problems that feature was and wasn't designed to solve - I believe this is it #1111852: Add a "More like this" feature
Comment #6
arrubiu CreditAttribution: arrubiu commentedHi!
I'm using the stable versione of this module, but I try to add a mlt block I obtain an error 400, bad request.
I follow instruction from #2
Comment #7
arrubiu CreditAttribution: arrubiu commentedany news?
I try it on a simple page and if I place the block I obtain this error:
An error occurred while trying to search with Solr: '413' Status: Request Entity Too Large.
Comment #8
ressa CreditAttribution: ressa commentedI followed the steps from post #2, remembering to select the correct search index (Product index), but can't seem to get any results when I click Preview.
Comment #9
nithinkolekar CreditAttribution: nithinkolekar commentedSame problem here :(. Followed exactly same steps as #2 , all fields are indexed but results are not showing.
While testing in view's preview by passing existing node id as parameter, it is displaying 'No query was run'.
Comment #10
sphism CreditAttribution: sphism commentedSame here, can't get this to work ... hmm
[edit] The view preview doesn't ever seem to work, but the block does work when i place it on a node page
[edit 2] Hmm... well the views preview is working now too, so everything is working fine. How odd. Possibly it doesn't work when you first make it, but does after a save... not sure... something is odd tho
Comment #11
Andre-Bsame problem here, solr 4.5 seems to be configured correct, double checked the api and did a manual search using mlt. but the view with more like this contextual filter is not showing anything.
Comment #12
Andre-BComment #13
Andre-BComment #14
drunken monkeyPlease debug the request sent to Solr and the response received, as described in the handbook, to see what could be wrong there.
Or did you already manage to solve this?
Comment #15
Amir Simantov CreditAttribution: Amir Simantov commentedAttention: mlt does not work out of the box. See the service classes supporting it.
Comment #16
drunken monkeyThis issue is five years old, please just don’t bump it for no reason!
Comment #17
Amir Simantov CreditAttribution: Amir Simantov commentedMy intention was good Thomas, I wanted to document it also here in case that someone will stumble upon this page and not the other one where you explained to me what I have commented here. Sorry that it was not clear. I appreciate your hard work and would not intentionally harm it. My appologies.