Class Condition

java.lang.Object
com.algolia.model.recommend.Condition

public class Condition extends Object
Condition
  • Constructor Details

    • Condition

      public Condition()
  • Method Details

    • setPattern

      public Condition setPattern(String pattern)
    • getPattern

      @Nullable public String getPattern()
      Query pattern that triggers the rule. You can use either a literal string, or a special pattern `{facet:ATTRIBUTE}`, where `ATTRIBUTE` is a facet name. The rule is triggered if the query matches the literal string or a value of the specified facet. For example, with `pattern: {facet:genre}`, the rule is triggered when users search for a genre, such as \"comedy\".
    • setAnchoring

      public Condition setAnchoring(Anchoring anchoring)
    • getAnchoring

      @Nullable public Anchoring getAnchoring()
      Get anchoring
    • setAlternatives

      public Condition setAlternatives(Boolean alternatives)
    • getAlternatives

      @Nullable public Boolean getAlternatives()
      Whether the pattern should match plurals, synonyms, and typos.
    • setContext

      public Condition setContext(String context)
    • getContext

      @Nullable public String 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.
    • setFilters

      public Condition setFilters(String filters)
    • getFilters

      @Nullable public String getFilters()
      Filters that trigger the rule. You can add add filters using the syntax `facet:value` so that the rule is triggered, when the specific filter is selected. You can use `filters` on its own or combine it with the `pattern` parameter.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object