on ‎2019 Dec 16 10:33 AM
We have a new requirement that is not to show in the results of solr the products with price 0, we are not sure which is the best to solve it.
Thank you very much in advance.
Request clarification before answering.
Hello, César.
Best way to achieve required result and make process configurable is to use FacetSearchListener
(detailed information can be found here: https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/1905/en-US/8c547232866910149b829fe3ca8e...)
For example:
@Override
public void beforeSearch(final FacetSearchContext facetSearchContext)
{
.....
final QueryField greaterThanQuery = new QueryField(MY_PRICE_FIELD,
SearchQuery.Operator.AND, SearchQuery.QueryOperator.GREATER_THAN, "0");
facetSearchContext.getSearchQuery().addFilterQuery(greaterThanQuery);
.....
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Igor. Very helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.