Excluding with search constraint.

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

Excluding with search constraint.

iwolf
Hi everybody,

I am trying to exclude products from search result by using a search constraint. (LayeredNavigation.groovy)

ProductSearchSession.searchAddConstraint(new ProductSearch.FeatureConstraint("21952", true), session); // ProductSearch.FeatureConstraint(productFeatureId, exclude)

It results in: "FieldName mainProductId not found for entity: DynamicViewEntity". If I set "exclude" to false it display the products as expected. But I want to exclude them.

Do I miss something?

Best regards,
Ingo
Reply | Threaded
Open this post in threaded view
|

Re: Excluding with search constraint.

Rishi Solanki
Can you please share the search context and query conditions passed in
query. You can obtain it from ProductSearch class.

--
Rishi Solanki
Sr Manager, Enterprise Software Development
HotWax Systems Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxsystems.com
www.hotwax.co


On Thu, Feb 28, 2019 at 4:37 PM Ingo Wolfmayr <[hidden email]>
wrote:

> Hi everybody,
>
> I am trying to exclude products from search result by using a search
> constraint. (LayeredNavigation.groovy)
>
> ProductSearchSession.searchAddConstraint(new
> ProductSearch.FeatureConstraint("21952", true), session); //
> ProductSearch.FeatureConstraint(productFeatureId, exclude)
>
> It results in: "FieldName mainProductId not found for entity:
> DynamicViewEntity". If I set "exclude" to false it display the products as
> expected. But I want to exclude them.
>
> Do I miss something?
>
> Best regards,
> Ingo
>
Reply | Threaded
Open this post in threaded view
|

AW: Excluding with search constraint.

iwolf
So far I restricted it to the getCount* methods in ProductSearchSessions. For example getCountForProductCategory. If I remove those the result is correct.

I use the "LayeredNavigation" from ecommerce plugin.
I added: ProductSearchSession.searchAddConstraint(new ProductSearch.FeatureConstraint("featureId_exclude", true), session);

The LayeredNavigation.groovy uses:
categoryCount = ProductSearchSession.getCountForProductCategory(subCategory.productCategoryId, session, delegator);

The dynamicViewEntity of that method fails due to the exlude-constraint.

-----Ursprüngliche Nachricht-----
Von: Rishi Solanki <[hidden email]>
Gesendet: Donnerstag, 28. Februar 2019 14:42
An: ofbizuser <[hidden email]>
Betreff: Re: Excluding with search constraint.

Can you please share the search context and query conditions passed in query. You can obtain it from ProductSearch class.

--
Rishi Solanki
Sr Manager, Enterprise Software Development HotWax Systems Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxsystems.com
www.hotwax.co


On Thu, Feb 28, 2019 at 4:37 PM Ingo Wolfmayr <[hidden email]>
wrote:

> Hi everybody,
>
> I am trying to exclude products from search result by using a search
> constraint. (LayeredNavigation.groovy)
>
> ProductSearchSession.searchAddConstraint(new
> ProductSearch.FeatureConstraint("21952", true), session); //
> ProductSearch.FeatureConstraint(productFeatureId, exclude)
>
> It results in: "FieldName mainProductId not found for entity:
> DynamicViewEntity". If I set "exclude" to false it display the
> products as expected. But I want to exclude them.
>
> Do I miss something?
>
> Best regards,
> Ingo
>
Reply | Threaded
Open this post in threaded view
|

AW: Excluding with search constraint.

iwolf
In reply to this post by Rishi Solanki
Added a  jira with patch.

https://issues.apache.org/jira/browse/OFBIZ-10845

Best regards,
Ingo

-----Ursprüngliche Nachricht-----
Von: Rishi Solanki <[hidden email]>
Gesendet: Donnerstag, 28. Februar 2019 14:42
An: ofbizuser <[hidden email]>
Betreff: Re: Excluding with search constraint.

Can you please share the search context and query conditions passed in query. You can obtain it from ProductSearch class.

--
Rishi Solanki
Sr Manager, Enterprise Software Development HotWax Systems Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxsystems.com
www.hotwax.co


On Thu, Feb 28, 2019 at 4:37 PM Ingo Wolfmayr <[hidden email]>
wrote:

> Hi everybody,
>
> I am trying to exclude products from search result by using a search
> constraint. (LayeredNavigation.groovy)
>
> ProductSearchSession.searchAddConstraint(new
> ProductSearch.FeatureConstraint("21952", true), session); //
> ProductSearch.FeatureConstraint(productFeatureId, exclude)
>
> It results in: "FieldName mainProductId not found for entity:
> DynamicViewEntity". If I set "exclude" to false it display the
> products as expected. But I want to exclude them.
>
> Do I miss something?
>
> Best regards,
> Ingo
>