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 a "more like this" block, and each node has a SOLR indexed decimal value "rating". I am trying to set this as the sort in the view, but the content isn't being sorted by this value.
Any ideas?
Thanks mate.
Comments
Comment #1
drunken monkeySorry, in its current implementation the results in the MLT block can't be sorted or filtered. This has to do with Solr internals, we'd have to use a different system to allow this.
Leaving this as a feature request for now, maybe someone will implement it.
On the other hand, when sorting by anything else than relevance, you'll likely get results which are hardly at all like the current node, so such a feature would be dangerous.
Comment #2
modstore CreditAttribution: modstore commentedActually, thats a good point. Now that I think about it I would need it sorted by relevance first, and because there is typically a lot of nodes of high relevance, I want the 5 most relevant displayed sorted by rating value. I think I am best off just using a hook to do this, as it is specific to my implementation.
EDIT: Although, I think it would be a nice feature to return results above a certain relevance, but sorted by another field.
Thanks Drunken Monkey, glad you're back!
Comment #3
Nick_vhI haven't checked the latest code yet but seems to me that having a sort for the more like this blocks seem like a quite reasonable feature request. Bumping it up to D8
Comment #4
Andre-B@Nick_vh how would the sorting work in theory? mlt should by default sort by relevance, sorting by anything else than relevance wouldn't be mlt at all? only thing I can think of is sorting by timestamp (new nodes first) - but shouldn't that be some sort of internal relevance boosting? filtering the results by relevance (for a minimum relevance) and then sorting them should provide somewhat relevant results, but that would bypass solr, so it does not seem to make much sense.
Comment #5
Andre-Bfor boosting newer documents one should read this: http://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_boost_the_score_o...
further reference: http://stackoverflow.com/questions/2179497/adding-date-boosting-to-compl...
Comment #6
legolasboThis issue has not seen activity in over 2,5 years. I am therefore closing this issue to clean up the issue queue. Feel free to re-open and update this issue if you feel this issue is still relevant and of importance.