Package com.algolia.model.recommend
Class Condition
java.lang.Object
com.algolia.model.recommend.Condition
Condition that triggers the rule. If not specified, the rule is triggered for all
recommendations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAn additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter.Filter expression to only include items that match the filter criteria in the response.inthashCode()setContext(String context) setFilters(String filters) toString()
-
Constructor Details
-
Condition
public Condition()
-
-
Method Details
-
setFilters
-
getFilters
Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** ``, where ` ` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** ` : TO ` where ` ` and ` ` are the lower and upper limits of the range (inclusive). - **Facet filters.** ` : ` where ` ` is a facet attribute (case-sensitive) and ` ` a facet value. - **Tag filters.** `_tags: ` or just ` ` (case-sensitive). - **Boolean filters.** ` : true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can't use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can't combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). -
setContext
-
getContext
An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter. For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`. A rule context must only contain alphanumeric characters. -
equals
-
hashCode
public int hashCode() -
toString
-