You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Ritesh Trivedi <ri...@gmail.com> on 2008/09/26 03:22:54 UTC

Good way to add additional search constraints?

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?
-- 
View this message in context: http://www.nabble.com/Good-way-to-add-additional-search-constraints--tp19681084p19681084.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.


Re: Good way to add additional search constraints?

Posted by Ritesh Trivedi <ri...@gmail.com>.
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?
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Good-way-to-add-additional-search-constraints--tp19681084p19681253.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.


Re: Good way to add additional search constraints?

Posted by Ritesh Trivedi <ri...@gmail.com>.
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?
> 

-- 
View this message in context: http://www.nabble.com/Good-way-to-add-additional-search-constraints--tp19681084p19681163.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.