Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6473885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:31:11+00:00 2026-05-25T06:31:11+00:00

I am planning on setting up a filter system (refine your search) in my

  • 0

I am planning on setting up a filter system (refine your search) in my ecommerce stores. You can see an example here: http://www.bettymills.com/shop/product/find/Air+and+HVAC+Filters

Platforms such as PrestaShop, OpenCart and Magento have what’s called a Layered Navigation.

My question is what is the difference between the Layered Navigation in platforms such as Magento or PrestaShop in comparison to using something like Solr or Lucene for faceted navigation.

Can a similar result be accomplished via just php and mysql?

A detailed explanation is much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:31:11+00:00Added an answer on May 25, 2026 at 6:31 am

    Layered Navigation == Faceted Search.

    They are the same thing, but Magento and al uses different wording, probably to be catchy. As far as I know, Magento supports both the Solr faceted search or the MySQL one. The main difference is the performance.

    Performance is the main trade-off.

    To do faceted search in MySQL requires you to join tables, while Solr indexes the document facets automatically for filtering. You can generally achieve fast response times using Solr (<100ms for a multi-facet search query) on average hardware. While MySQL will take longer for the same search, it can be optimized with indexes to achieve similar response times.

    The downside to Solr is that it requires you to configure, secure and run yet another service on your server. It can also be pretty CPU and memory intensive depending on your configuration (Tomcat, jetty, etc.).

    Faceted search in PHP/MySQL is possible, and not as hard as you’d think.

    You need a specific database schema, but it’s feasible. Here’s a simple example:

    product

    +----+------------+
    | id | name       |
    +----+------------+
    |  1 | blue paint |
    |  2 | red paint  |
    +----+------------+
    

    classification

    +----+----------+
    | id | name     |
    +----+----------+
    |  1 | color    |
    |  2 | material |
    |  3 | dept     |
    +----+----------+
    

    product_classification

    +------------+-------------------+-------+
    | product_id | classification_id | value |
    +------------+-------------------+-------+
    |          1 |                 1 | blue  |
    |          1 |                 2 | latex |
    |          1 |                 3 | paint |
    |          1 |                 3 | home  |
    |          2 |                 1 | red   |
    |          2 |                 2 | latex |
    |          2 |                 3 | paint |
    |          2 |                 3 | home  |
    +------------+-------------------+-------+
    

    So, say someones search for paint, you’d do something like:

    SELECT p.* FROM product p WHERE name LIKE '%paint%';
    

    This would return both entries from the product table.

    Once your search has executed, you can fetch the associated facets (filters) of your result using a query like this one:

    SELECT c.id, c.name, pc.value FROM product p
       LEFT JOIN product_classification pc ON pc.product_id = p.id
       LEFT JOIN classification c ON c.id = pc.classification_id
    WHERE p.name LIKE '%paint%'
    GROUP BY c.id, pc.value
    ORDER BY c.id;
    

    This’ll give you something like:

    +------+----------+-------+
    | id   | name     | value |
    +------+----------+-------+
    |    1 | color    | blue  |
    |    1 | color    | red   |
    |    2 | material | latex |
    |    3 | dept     | home  |
    |    3 | dept     | paint |
    +------+----------+-------+
    

    So, in your result set, you know that there are products whose color are blue and red, that the only material it’s made from is latex, and that it can be found in departments home and paint.

    Once a user select a facet, just modify the original search query:

    SELECT p.* FROM product p
       LEFT JOIN product_classification pc ON pc.product_id = p.id
    WHERE 
       p.name LIKE '%paint%' AND (
          (pc.classification_id = 1 AND pc.value = 'blue') OR
          (pc.classification_id = 3 AND pc.value = 'home')
       )
    GROUP BY p.id
    HAVING COUNT(p.id) = 2;
    

    So, here the user is searching for keyword paint, and includes two facets: facet blue for color, and home for department. This’ll give you:

    +----+------------+
    | id | name       |
    +----+------------+
    |  1 | blue paint |
    +----+------------+
    

    So, in conclusion. Although it’s available out-of-the-box in Solr, it’s possible to implement it in SQL fairly easily.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am planning a system that requires collaboration between many local Rails apps. The
After reading http://gbif.blogspot.com/2011/01/setting-up-hadoop-cluster-part-1-manual.html we came to the conclusion our 6-nodes hadoop cluster could use
We're planning on setting up a website for student group - most of the
Was planning to move from setting up cron jobs to Quartz scheduler. What are
I'm looking at setting up In App Purchases for an iPhone app. I'm planning
Am planning to use cookies to communicate between two browser windows. Am wondering if
Im planning to create an Alert view with three buttons, my problem is I
im planning to create a movie file that might have over 16,000 frames?i know
Iam planning to create an app, and not to publish it at the google
I'm planning on doing more coding from home but in order to do so,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.