As it is written, this plugin seems to only return node results that actually have ANY of the tags of the nid passed in as similarbyterms.nid. I would like to sort by similar by terms, but not limit the results to only those with matching tags. Is there a way to do this? In other words, I want ALL nodes included as part of my view, but still want to sort by similar, without limiting those results to only nodes with any matching tags. Those with no matches, are still inlcuded, just at the bottom of the list since they don't match at all....
Comments
Comment #1
jjeff commentedUnfortunately, there's not an easy way to do this. Here's a typical SQL query for the default SBT2 view:
Note the part that says
term_node.tid IN (139, 84, 140, 48, 74, 8)This basically says, "find other nodes with the same terms as those associated with this node." And the combination of the
COUNT(node.nid)and theGROUP BY nidprovides the sorting functionality. Unfortunately, there's not a way that I'm aware of to include nodes which don't match this criteria while still allowing us to sort/view by similarity.If anyone knows of a way to make this work, I'm open to it. It's just beyond my understanding at this point.
Comment #2
Big Z commentedI was looking for this exact functionality. After thinking for a while I decided to spin the problem on its head and attack it from the taxonomy side.
Using the Taxonomy Defaults module you can give every node you create a default (hidden) term. This has no affect on the ordering produced by the SBT sort, but does include every node!
The only problem is nodes that already exist need to be updated to include the default term. Maybe a bulk update utility exists out there or a simple update query could be run on the term_node table.
Hope this helps.
Professional Drupal Development
www.vitalatus.co.uk
Comment #3
takim commented