I have a couple of situations where I have a list of products and I want to display the most similar products to the article in question. How in a lot of situations there is no commonality between the article and any product or there is not enough products to fill the list. In this case I just want to display any product.

This modification attached changes the select to instead of being a filter it adds an embedded select to give a count of the number of terms in common between the argument and the row. This then changes the sort to allow you to sort by the number of terms in common and returns a list of products which are most similar by term to not similar at all.

I usually couple this with the random sort so that it would pick up different products.

Comments

jordojuice’s picture

Might the changes made in #1181566: Compatibility with views 3 also need to be applied to this patch?

freddybushboy’s picture

I haven't tried your patch but I think this would be a great feature!

It would be fantastic to have Similarity as a filter OR a sort that can be used without the filter.

doublejosh’s picture

Issue summary: View changes

For anyone who happens across this post, there IS indeed a sort within Similar By Terms.

Additionally, you CAN pass in a list of TIDs via contextual filter and sort by match rate. You are NOT stuck only passing in a NID.

Yay!!!

luksak’s picture

Title: Similar sort, and not filter. » Similar sort without filter
Version: 6.x-2.2 » 8.x-1.x-dev
Status: Needs review » Needs work

I guess we want to fix that in 8.x first. Also changing the title to something more useful.

shelane’s picture

  • shelane committed 5060fb3c on 8.x-1.x
    feat: #1319114 Similar sort without filter
    
shelane’s picture

Assigned: gordon » Unassigned
Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.