eZ Community » Forums » Extensions » eZ Find » Excluding child products from search...
expandshrink

Excluding child products from search results

Excluding child products from search results

Friday 04 July 2014 10:06:29 am - 1 reply

I'm implementing eZFind 2.7 on a site with a basic structure of categories and products. So far so good. Although some products also have child products (e.i. same content class).

  • Category (category)
    • Main product (product)
      • A child product (product)
      • Another child product  (product)

I'm looking for the best practice approach to excluding these child products from the search results. Ideally a hit on a child product should display the main product.

Hopefully this is not some unique case. Any help is appreciated!

Saturday 05 July 2014 6:30:22 am

Hi Fredrik,

this case is not that unique.
There are 3 ways i know to solve this.

  1. If the child-products always are on the same depth, you may filter the depth.
    This however will exclude them from search, and will not result in displaying the parent.
  2. The other way is (the one that i choose back then) to just send the request and remove the sub-pages/products from the result-set.
    On remove you can check if the parent is already in the resultset. If not, just add it.
  3. When using a solr-core with version > 4, you can also use a join on the same core.
    I have not been using this yet, but know whats the theory behind it.
    This has to be combined by sending filters though get and post to solr which is kind of abstract.

Anyway the probably most common way, would be the second.
However i personally mind it since the performance and filtering has a layer on the php-side. sad.gif Emoticon

Why don't you use a different class for sub-products anyway?
This class could be a copy of the original product and would only have new ids and a different identifier.

Modified on Saturday 05 July 2014 6:32:44 am by Steve Konrad

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from