Class SolrSearchCondition
- java.lang.Object
-
- com.hybris.backoffice.solrsearch.dataaccess.SolrSearchCondition
-
- All Implemented Interfaces:
java.io.Serializable
public class SolrSearchCondition extends java.lang.Object implements java.io.SerializableRepresentation of solr search condition.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSolrSearchCondition.ConditionValue
-
Constructor Summary
Constructors Constructor Description SolrSearchCondition(java.lang.String attributeName, java.lang.String attributeType, boolean multiValue, java.util.Locale locale, SearchQuery.Operator operator, boolean filterQueryCondition)Creates condition for specified attribute and locale.SolrSearchCondition(java.lang.String attributeName, java.lang.String attributeType, SearchQuery.Operator operator)Creates condition for specified attribute and locale.SolrSearchCondition(java.lang.String attributeName, java.lang.String attributeType, java.util.Locale language, SearchQuery.Operator operator)Creates condition for specified attribute and locale.SolrSearchCondition(java.util.List<SolrSearchCondition> nestedConditions, SearchQuery.Operator operator)Creates condition which aggregates nested conditions.SolrSearchCondition(java.util.List<SolrSearchCondition> nestedConditions, SearchQuery.Operator operator, boolean filterQueryCondition)Creates condition which aggregates nested conditions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConditionValue(java.lang.Object value, com.hybris.cockpitng.search.data.ValueComparisonOperator comparisonOperator)Adds a value to the condition.java.lang.StringgetAttributeName()java.lang.StringgetAttributeType()java.util.List<SolrSearchCondition.ConditionValue>getConditionValues()java.util.LocalegetLanguage()java.util.List<SolrSearchCondition>getNestedConditions()SearchQuery.OperatorgetOperator()booleanisFilterQueryCondition()Informs if it is a filter query (fq) condition.booleanisMultiValue()Tells if indexed property for this type is multi valueIndexedProperty.isMultiValue()booleanisNestedCondition()Informs if it is aggregating condition which consists of nested conditions.
-
-
-
Constructor Detail
-
SolrSearchCondition
public SolrSearchCondition(java.lang.String attributeName, java.lang.String attributeType, java.util.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 combinegetConditionValues().
-
SolrSearchCondition
public SolrSearchCondition(java.lang.String attributeName, java.lang.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 combinegetConditionValues().
-
SolrSearchCondition
public SolrSearchCondition(java.lang.String attributeName, java.lang.String attributeType, boolean multiValue, java.util.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 fieldIndexedProperty.isMultiValue().locale- locale of the condition chosen in the condition it can be different than current user's locale.operator- operator used to combinegetConditionValues().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(java.util.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(java.util.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 Detail
-
getNestedConditions
public java.util.List<SolrSearchCondition> getNestedConditions()
-
getAttributeName
public java.lang.String getAttributeName()
-
getAttributeType
public java.lang.String getAttributeType()
-
getLanguage
public java.util.Locale getLanguage()
-
getOperator
public SearchQuery.Operator getOperator()
-
isMultiValue
public boolean isMultiValue()
Tells if indexed property for this type is multi valueIndexedProperty.isMultiValue()- Returns:
- true if is multi value.
-
getConditionValues
public java.util.List<SolrSearchCondition.ConditionValue> getConditionValues()
-
addConditionValue
public void addConditionValue(java.lang.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 queryValueComparisonOperator
-
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.
-
-