Good way to add additional search constraints?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Good way to add additional search constraints?

Ritesh Trivedi
Hi,

Not being a SQL guru, I do not fully understand more than 2 table joins and its impact. I just tried to add an additional search contraint to NOT include products from certain categories. Turns out, if the PRODUCT CATEGORY MEMBER already exists as a constraint, adding another one is causing incorrect results - returning more products than expected.

I was under the impression, all constraints are independent as they add their own table, join and criteria as well as fields etc. But as I found out that certainly is not true.

Was wondering what is a "good" way to add non-conflicting additional constraints to extend the search functionality?
Reply | Threaded
Open this post in threaded view
|

Re: Good way to add additional search constraints?

Ritesh Trivedi
Let me actually add -

I fully understand that framework is extensible and supports adding new constraints and are obviously as good as the conditions provided by the constraint writer.

So I guess a better way to ask the question would be -
if I want a constraint  for excluding products from certain categories, keeping in mind that there are existing constraints like CatalogConstraint and CategoryContraint which my conflict with this - what would a good where condition for this excluding products from categories constraint?

Ritesh Trivedi wrote
Hi,

Not being a SQL guru, I do not fully understand more than 2 table joins and its impact. I just tried to add an additional search contraint to NOT include products from certain categories. Turns out, if the PRODUCT CATEGORY MEMBER already exists as a constraint, adding another one is causing incorrect results - returning more products than expected.

I was under the impression, all constraints are independent as they add their own table, join and criteria as well as fields etc. But as I found out that certainly is not true.

Was wondering what is a "good" way to add non-conflicting additional constraints to extend the search functionality?
Reply | Threaded
Open this post in threaded view
|

Re: Good way to add additional search constraints?

Ritesh Trivedi
I just figured it out...

Have to add category ids to exclude to the ProductSearchContext.excludeCategoryIds.

But if someone wants to answer this question for more general solution about extending constraints that would help.


Ritesh Trivedi wrote
Let me actually add -

I fully understand that framework is extensible and supports adding new constraints and are obviously as good as the conditions provided by the constraint writer.

So I guess a better way to ask the question would be -
if I want a constraint  for excluding products from certain categories, keeping in mind that there are existing constraints like CatalogConstraint and CategoryContraint which my conflict with this - what would a good where condition for this excluding products from categories constraint?

Ritesh Trivedi wrote
Hi,

Not being a SQL guru, I do not fully understand more than 2 table joins and its impact. I just tried to add an additional search contraint to NOT include products from certain categories. Turns out, if the PRODUCT CATEGORY MEMBER already exists as a constraint, adding another one is causing incorrect results - returning more products than expected.

I was under the impression, all constraints are independent as they add their own table, join and criteria as well as fields etc. But as I found out that certainly is not true.

Was wondering what is a "good" way to add non-conflicting additional constraints to extend the search functionality?