public class CatalogSearchCriteria
extends java.lang.Object
implements java.io.Serializable
It takes three parameter to create a CatalogSearchCriteria object. First parameter being an attribute value on which you intend to search on, It could be either TAGS or CATEGORY. Second argument is value using which you want to perform search. Third parameter is the operator
Way to create SearchCriteria object is
CatalogSearchCriteria criteria = new CatalogSearchCriteria(Argument.TAG, "Marketing FINANACE", Operator.EQUAL);
In the above example: CatalogSearchCriteria criteria = new CatalogSearchCriteria(Argument.TAG, "Marketing FINANACE", Operator.EQUAL); User wants to search all the catalog items with tag as Marketing and FINANACE.
To create more complex SearchCriteria object, say for example while refining search
CatalogSearchCriteria criteria = new CatalogSearchCriteria(Argument.TAG, "Marketing FINANACE", Operator.EQUAL);
CatalogSearchCriteria criteria1 = new CatalogSearchCriteria(Argument.CATEGORY, "Finance,ADServer", Operator.EQUAL);
CatalogSearchCriteria criteria2 = new CatalogSearchCriteria(criteria, criteria1, Operator.AND);
In the above example user wants to search with tag as Marketing and FINANACE. Category he has selected as Finance,ADServer. For category the point to note is, if user wants to have more than one category then values should be Comma(,) separated.
Modifier and Type | Class and Description |
---|---|
static class |
CatalogSearchCriteria.Argument |
static class |
CatalogSearchCriteria.Operator |
static class |
CatalogSearchCriteria.SortCriteria |
Constructor and Description |
---|
CatalogSearchCriteria(java.lang.Object leftOperand,
java.lang.Object rightOperand,
CatalogSearchCriteria.Operator op) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getFirstArgument() |
CatalogSearchCriteria.Operator |
getOperator() |
java.lang.Object |
getSecondArgument() |
java.lang.String |
toString() |
public CatalogSearchCriteria(java.lang.Object leftOperand, java.lang.Object rightOperand, CatalogSearchCriteria.Operator op)
public CatalogSearchCriteria.Operator getOperator()
public java.lang.Object getFirstArgument()
public java.lang.Object getSecondArgument()
public java.lang.String toString()
toString
in class java.lang.Object