Count total weights of similar terms and order by them

Created on 1 June 2014, over 11 years ago
Updated 29 July 2025, 3 months ago

Use case: visitor browses e-shop and enters product page of some kind. There he sees a View of related "Smilar by terms" products - the same brand, size, price range, whatever else etc. With the current module it is not possible to order the list of similar products by _combined_ weight of all their terms: I want to sell more BrandA (5 weight points) and less BrandB (1 weight point), and more of price range of "101-500$" (200 weight points) than "1-100$" (50 weight points) so lets order them accordingly. Is this possible??? Not quite sure... Haven't used any weighed logic before, so if it is possible already with some kind of Computed Field tricks - please forgive me.

The second feature (which is possible only with the first one available) is a much much more complicated scenario: Order the list of similar products by sum of the weights of the terms which are _the same_ on those products. Only the weight of matching terms are counted!!! For example in vocabulary "Gender" are terms "Male" and "Female" of the same weight of 50 weight points and in vocabulary "Brand name" are terms of Nike (1 weight point), Reebok (2) , Adidas (2), Puma (4) then for user who looks the man sports shoes (Nike Air max sneakers :)) page he gets similar products ordered as this: Nike man shoes (51 weight, as gender and brand match), Reebok man shoes (50 weight, as brand does not match!), Nike woman shoes (1 weight as only brand match), Reebok woman shoes (0 weight as none of the term match). For the product of the woman sports shoes (Adidas) similar products ordered as this: Adidas woman shoes (52 weight), Reebok woman shoes (50 weight, as brand does not match!), Adidas man shoes (2 weight as only brand match), Reebok man shoes (0 weight as none of the term match).

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇱🇹Lithuania playfulwolf

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Ciao,

    we're digging into similar-by-terms and wondering if any advancement has been done about this issue. Even the related issue, pointing to https://www.drupal.org/project/taxonomy_entity_index remains unclear. Trying to wrap-up the question: does anyone managed to assign a given weight to a taxonomy to match with contents or other entities?

    A use case scenario:

    - Content type "A" is related to taxonomies "1" and "2", matching it with another content type "B" thanks to the great similar-by-terms
    - The match with the taxonomy 1 should have a weight bigger than the match with taxonomy 2. Eg: 0.75 > taxonomy 1; 0.25 > taxonomy 2

    this could be very useful for situations in which a match by similarities between two content type need to be biased towards a given result: the typical situation is for educational purpose, eg when you want to clearly show how a bias works (preferences, cultural pressures, etc.).

    A possible workaround: create more than one view to match the taxonomy you want to "privilege" > cut out the duplicate results: looks maybe doable, but not elegant nor easy to handle.

    So, it would be great to have this "weight" feature in similar-by-terms

    suggestions are welcome!

    thanks

    a.

Production build 0.71.5 2024