Class SolrSearchCondition

java.lang.Object
com.hybris.backoffice.solrsearch.dataaccess.SolrSearchCondition
All Implemented Interfaces:
Serializable

public class SolrSearchCondition extends Object implements Serializable
Representation of solr search condition.
See Also:
  • Constructor Details

    • SolrSearchCondition

      public SolrSearchCondition(String attributeName, String attributeType, Locale language, SearchQuery.Operator operator)
      Creates condition for specified attribute and locale. All values of the condition are combined with given operator.
      Parameters:
      attributeName - attribute name of field which is specified in this condition.
      attributeType - attribute type of field which is specified in this condition.
      language - locale of the condition. If condition locale equals current user's locale.
      operator - operator used to combine getConditionValues().
    • SolrSearchCondition

      public SolrSearchCondition(String attributeName, String attributeType, SearchQuery.Operator operator)
      Creates condition for specified attribute and locale. All values of the condition are combined with given operator.
      Parameters:
      attributeName - attribute name of field which is specified in this condition.
      attributeType - attribute type of field which is specified in this condition.
      operator - operator used to combine getConditionValues().
    • SolrSearchCondition

      public SolrSearchCondition(String attributeName, String attributeType, boolean multiValue, Locale locale, SearchQuery.Operator operator, boolean filterQueryCondition)
      Creates condition for specified attribute and locale. All values of the condition are combined with given operator. Allows to specify if indexed property is multi value. Allows to notify Solr that it should use this condition as filter query.
      Parameters:
      attributeName - attribute name of field which is specified in this condition.
      attributeType - attribute type of field which is specified in this condition.
      multiValue - tells if indexed property is multi value field IndexedProperty.isMultiValue().
      locale - locale of the condition chosen in the condition it can be different than current user's locale.
      operator - operator used to combine getConditionValues().
      filterQueryCondition - tells if condition should be used as fq (filter query). Setting to false doesn't necessarily mean it won't be used as fq, because every condition can be used as fq if its type and operator is a good match for it.
    • SolrSearchCondition

      public SolrSearchCondition(List<SolrSearchCondition> nestedConditions, SearchQuery.Operator operator)
      Creates condition which aggregates nested conditions. It's not bound to any specific attribute just has conditions and operator which combines them them.
      Parameters:
      nestedConditions - list of nested conditions.
      operator - operator used to combine nested conditions.
    • SolrSearchCondition

      public SolrSearchCondition(List<SolrSearchCondition> nestedConditions, SearchQuery.Operator operator, boolean filterQueryCondition)
      Creates condition which aggregates nested conditions. It's not bound to any specific attribute just has conditions and operator which combines them them.
      Parameters:
      nestedConditions - list of nested conditions.
      operator - operator used to combine nested conditions.
      filterQueryCondition - tells if condition should be used as fq (filter query)
  • Method Details

    • getNestedConditions

      public List<SolrSearchCondition> getNestedConditions()
    • getAttributeName

      public String getAttributeName()
    • getAttributeType

      public String getAttributeType()
    • getLanguage

      public Locale getLanguage()
    • getOperator

      public SearchQuery.Operator getOperator()
    • isMultiValue

      public boolean isMultiValue()
      Tells if indexed property for this type is multi value IndexedProperty.isMultiValue()
      Returns:
      true if is multi value.
    • getConditionValues

      public List<SolrSearchCondition.ConditionValue> getConditionValues()
    • addConditionValue

      public void addConditionValue(Object value, com.hybris.cockpitng.search.data.ValueComparisonOperator comparisonOperator)
      Adds a value to the condition.
      Parameters:
      value - value which will be used in condition.
      comparisonOperator - operator used in a query ValueComparisonOperator
    • isNestedCondition

      public boolean isNestedCondition()
      Informs if it is aggregating condition which consists of nested conditions.
      Returns:
      true if it is aggregating condition.
    • isFilterQueryCondition

      public boolean isFilterQueryCondition()
      Informs if it is a filter query (fq) condition.