D
D
Dmitry Kuzmin2016-01-19 07:41:00
PHP
Dmitry Kuzmin, 2016-01-19 07:41:00

Similar products - what is the implementation logic?

How to implement similar products functionality on the site? With the help of only queries in the database, I think this will not work. Description of work: there is a product with characteristics (price, color, other technical characteristics). In the absence of the selected product (availability = 0), offer the most similar product from this category of goods. I still understand how to compare by digital values ​​in characteristics, but what if we are dealing with a characteristic that is alphabetic, for example, white? You can use dictionaries, of course. Implementation in PHP+Mysql. Do not offer the development of third-party startup projects, I consider them a waste of money for such functionality.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
X
xmoonlight, 2016-01-19
@xmoonlight

In 3 stages.
1. The nearest numerical characteristics of available goods relative to the missing: each separately up and down, the formation of a list with relevance weights.
2. Substitution of text variables and search in the list (from item 1) using the Levenshtein distance algorithm with the formation of YOUR list of relevance weights.
3. Combining these two lists with the summation of weight indicators and subsequent sorting by weight values: the highest weight will be the most similar substitute.
PS: if you have in the database: "yellow", "yellow", "sand", "sand", "light yellow", "light sand" - then here you should use a synonymizer written by hand for use before step 2 .

D
Dmitry Bay, 2016-01-19
@kawabanga

- Easiest option
Suggest products from the same category. Simple, Bold, Functional.
- More difficult
From the same category, but with a price.
- More difficult
Write a function that searches for goods by fundamental characteristics, for example, if this is a clothing store, then such a characteristic is the size of clothes. Well, search accordingly in the same category.
- Perversion
For each product, assign similar ones manually. Saw in CMS as that such implementation.
There are many ways, only you can choose what you want.

V
Viverov, 2016-01-29
@Viverov

If you want to do perversion, then:
https://www.youtube.com/watch?v=tywGoQv1G6I
BigData module logic underwear

A
Andrey, 2016-01-19
@VladimirAndreev

- try to collect statistics on clicks close in time from one search results page.
- with flowers, etc. - you can create a table of colors and indicate in the product the color id from this table and make selections based on it, and let the content call the same pink color as they want in their descriptions

M
Mikhail Rozhkov, 2016-01-19
@shogunkub

In addition to the above, you can add tagging and display products with matching tags (more than one match, sort in descending order of the number of matches). But it is necessary, naturally, then still a convenient tool for editing the list of tags to invent.

D
Dimonchik, 2016-01-19
@dimonchik2013

sphinxsearch, get used to facetes
, such tasks are solved only in this way, well, or on another engine
you can still look towards neo4j, but the logic is more confusing there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question