V
V
Viktor Vsk2015-05-26 18:45:55
Sphinx
Viktor Vsk, 2015-05-26 18:45:55

Active Filtering in an online store using search engines (Spinx, Solr)?

Online stores have product filters. They call it, sort of, Active Filtering.
Let's say we have laptops (products). Notebooks have many filter values ​​(product_filter_values), which in turn are associated with filter types (filter_types) and filter values ​​(filter_values).

НОУТБУКИ (products)
Диагональ экрана (filter_types)
  11 (filter_values)
  13.3
  15.6
Процессор
  Intel
  AMD

Now, let's say we only want to see laptops with 11 and 13.3 diagonals, and we also don't recognize AMD.
It would seem that everything is simple and the task is the most typical, but now it works in such a terrible way:
SELECT products.id
  FROM products
  INNER JOIN
    product_filter_values ON product_filter_values.product_id = products.id
  WHERE
    product_filter_values.filter_value_id IN (1,2)      

INTERSECT

SELECT products.id
  FROM products
  INNER JOIN
    product_filter_values ON product_filter_values.product_id = products.id
  WHERE
    product_filter_values.filter_value_id IN (4)

And although it's not that slow, it seems like a crutch + there is no convenient way to do a normal faceted search (that would display pluses, for example: AMD (+3))
There must be a way to implement this using Sphinx or a similar search engine?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fortop, 2015-05-26
@Fortop

sphinxsearch.com/blog/2013/06/21/faceted-search-wi...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question