Package com.documentum.fc.client.search
Interface IDfExpressionSet
- All Superinterfaces:
IDfExpression
Defines a set of search expressions.
Add other search expressions to this set to construct a full search expression.
Construct the search expression ((A contains VALUE1) or (B equals VALUE2 and C equals VALUE3))
Add other search expressions to this set to construct a full search expression.
This set of search expressions is used in IDfQueryBuilder to construct a search query.
Usage samples:
Construct the search expression ((A contains VALUE1) and (B equals VALUE2))
IDfExpressionSet rootExprSet = queryBuilder.getRootExpressionSet();
rootExprSet.addSimpleAttrExpression("A", IDfValue.DF_STRING, IDfSimpleAttrExpression.SEARCH_OP_CONTAINS, true,
false,
"VALUE1");
rootExprSet.addSimpleAttrExpression("B", IDfValue.DF_STRING, IDfSimpleAttrExpression.SEARCH_OP_EQUAL, true, false,
"VALUE2");
Construct the search expression ((A contains VALUE1) or (B equals VALUE2 and C equals VALUE3))
IDfExpressionSet rootExprSet = queryBuilder.getRootExpressionSet();
IDfExpressionSet exprSetOr = rootExprSet.addExpressionSet(IDfExpressionSet.LOGICAL_OP_OR);
exprSetOr.addSimpleAttrExpression("A", IDfValue.DF_STRING, IDfSimpleAttrExpression.SEARCH_OP_CONTAINS, true, false,
"VALUE1");
IDfExpressionSet exprSetAnd = exprSetOr.addExpressionSet(IDfExpressionSet.LOGICAL_OP_AND);
exprSetAnd.addSimpleAttrExpression("B", IDfValue.DF_STRING, IDfSimpleAttrExpression.SEARCH_OP_EQUAL, true, false,
"VALUE2");
exprSetAnd.addSimpleAttrExpression("C", IDfValue.DF_STRING, IDfSimpleAttrExpression.SEARCH_OP_EQUAL, true, false,
"VALUE3");
With external sources, the OR operator is not supported between two different attributes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intLogical operator: AND.static final intLogical operator: default (that is, AND).static final intLogical operator: OR.Fields inherited from interface com.documentum.fc.client.search.IDfExpression
DATE_FORMAT_DEFAULT, EXPR_TYPE_FULLTEXT, EXPR_TYPE_MLT, EXPR_TYPE_RELATIVE_DATE, EXPR_TYPE_SET, EXPR_TYPE_SIMPLE_ATTR, EXPR_TYPE_UNDEFINED, EXPR_TYPE_VALUE_LIST_ATTR, EXPR_TYPE_VALUE_RANGE_ATTR -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExpression(IDfExpression expression) Add an expression in this expression set.Adds an expression set to this expression set.addExpressionSet(int logicalOperator) Adds an expression set to this expression set.addFullTextExpression(String strValue) Adds a full-text search expression to this expression set.addRelativeDateExpression(String attrName, int searchOpCode, boolean isRepeated, int relativeTime, int timeUnit) Adds a relative date expression to this expression set.addSimpleAttrExpression(String attrName, int valueDataType, int searchOp, boolean isCaseSensitive, boolean isRepeated, String value) Adds a simple attribute value expression to this expression set.addValueListAttrExpression(String attrName, int valueDataType, int searchOp, boolean isCaseSensitive, boolean isRepeated) Adds a search expression that requires the attribute value to be included in a list of values.addValueListAttrExpression(String attrName, int valueDataType, int searchOp, boolean isCaseSensitive, boolean isRepeated, IDfList valueList) Adds a search expression that requires the attribute value to be included in a list of values.addValueRangeAttrExpression(String attrName, int valueDataType, int searchOp, boolean isCaseSensitive, boolean isRepeated, String fromValue, String toValue) Adds a search expression that requires the attribute value to be within a range.Get the proximity operator used to run proximity search..intGets the number of expressions contained in this expression set.Gets the list of expressions contained by this expression set.intGets the logical operator applied between each expression of this set.voidsetDistance(PositionalOperator positionalOperator) Sets the positional operator used to run proximity search.voidsetLogicalOperator(int logicalOperator) Sets the logical operator applied between each expression of this set.Methods inherited from interface com.documentum.fc.client.search.IDfExpression
acceptVisitor, getDateFormat, getExpressionType, setDateFormat
-
Field Details
-
LOGICAL_OP_AND
static final int LOGICAL_OP_ANDLogical operator: AND.- See Also:
-
LOGICAL_OP_OR
static final int LOGICAL_OP_ORLogical operator: OR.- See Also:
-
LOGICAL_OP_DEFAULT
static final int LOGICAL_OP_DEFAULTLogical operator: default (that is, AND).- See Also:
-
-
Method Details
-
getExpressionCount
int getExpressionCount()Gets the number of expressions contained in this expression set.- Returns:
- The number of expressions.
-
getExpressions
IDfEnumeration getExpressions()Gets the list of expressions contained by this expression set.- Returns:
- The list of expressions (
IDfEnumerationofIDfExpression) - See Also:
-
addSimpleAttrExpression
IDfSimpleAttrExpression addSimpleAttrExpression(String attrName, int valueDataType, int searchOp, boolean isCaseSensitive, boolean isRepeated, String value) Adds a simple attribute value expression to this expression set.- Parameters:
attrName- The attribute name.valueDataType- The data type of the value (constants defined inIDfValue, such asDF_STRING).searchOp- The search operation code (constants defined inIDfAttrExpressionandIDfSimpleAttrExpression, such asSEARCH_OP_CONTAINS).isCaseSensitive-trueif the search operation is case sensitive;falseotherwise. When the backend is not a database, searching is always case insensitive; this property will be ignored.isRepeated-trueif the attribute is repeated;falseotherwise.value- The expected value of the search operation; ornullif there is no value (for example: for IS_NULL or IS_NOT_NULL operator).- Returns:
- The new simple attribute value expression created and added.
- See Also:
-
addRelativeDateExpression
IDfRelativeDateExpression addRelativeDateExpression(String attrName, int searchOpCode, boolean isRepeated, int relativeTime, int timeUnit) Adds a relative date expression to this expression set. For example, ifsearchOpCode=GREATER_THAN,relativeTime=-3,timeUnit=MONTH, then the expression defines a constraint on a date that must be greater than the current date minus 3 months.- Parameters:
attrName- The attribute name.searchOpCode- The search operation code (constants defined inIDfAttrExpressionandIDfSimpleAttrExpression, such asSEARCH_OP_CONTAINS).isRepeated-trueif the attribute is repeated;falseotherwise.relativeTime- The relative time to add to the actual date of the query execution.timeUnit- The time unit (Calendar.MINUTE, Calendar.DAY_OF_MONTH, Calendar.MONTH, Calendar.YEAR).- Returns:
- The new relative date expression created and added.
- See Also:
-
addValueRangeAttrExpression
IDfValueRangeAttrExpression addValueRangeAttrExpression(String attrName, int valueDataType, int searchOp, boolean isCaseSensitive, boolean isRepeated, String fromValue, String toValue) Adds a search expression that requires the attribute value to be within a range.- Parameters:
attrName- The attribute name.valueDataType- The data type of the value (constants defined inIDfValue, for example,DF_STRING).searchOp- The search operation code (constants defined inIDfAttrExpressionandIDfSimpleAttrExpression, for example,SEARCH_OP_CONTAINS).isCaseSensitive-trueif the search operation is case sensitive;falseotherwise. When the backend is not a database, searching is always case insensitive; this property will be ignored.isRepeated-trueif the attribute is repeated;falseotherwise.fromValue- The minimum value of the range (included).toValue- The maximum value of the range (included).- Returns:
- The new search expression created and added.
- See Also:
-
addValueListAttrExpression
IDfValueListAttrExpression addValueListAttrExpression(String attrName, int valueDataType, int searchOp, boolean isCaseSensitive, boolean isRepeated) Adds a search expression that requires the attribute value to be included in a list of values. The list of values is initially empty. New values can be added directly on theIDfValueListAttrExpressionreturned.- Parameters:
attrName- The attribute name.valueDataType- The data type of the value (constants defined inIDfValue, for example,DF_STRING).searchOp- The search operation code (constants defined inIDfAttrExpressionandIDfSimpleAttrExpression, for example,SEARCH_OP_CONTAINS).isCaseSensitive-trueif the search operation is case sensitive;falseotherwise. When the backend is not a database, searching is always case insensitive; this property will be ignored.isRepeated-trueif the attribute is repeated;falseotherwise.- Returns:
- The new search expression created and added.
- See Also:
-
addValueListAttrExpression
IDfValueListAttrExpression addValueListAttrExpression(String attrName, int valueDataType, int searchOp, boolean isCaseSensitive, boolean isRepeated, IDfList valueList) Adds a search expression that requires the attribute value to be included in a list of values.- Parameters:
attrName- The attribute name.valueDataType- The data type of the value (constants defined inIDfValue, for example,DF_STRING).searchOp- The search operation code (constants defined inIDfAttrExpressionandIDfSimpleAttrExpression, for example,SEARCH_OP_CONTAINS).isCaseSensitive-trueif the search operation is case sensitive;falseotherwise. When the backend is not a database, searching is always case insensitive; this property will be ignored.isRepeated-trueif the attribute is repeated;falseotherwise.valueList- The list of values (IDfListofString). The non-string values are skipped.- Returns:
- The new search expression created and added.
- See Also:
-
addFullTextExpression
Adds a full-text search expression to this expression set.- Parameters:
strValue- The string to look for in full text.- Returns:
- The new full-text search expression created and added.
-
addExpressionSet
IDfExpressionSet addExpressionSet()Adds an expression set to this expression set. The new expression set is created with the default logical operator (that is,AND).- Returns:
- The new expression set created and added.
-
addExpressionSet
Adds an expression set to this expression set.- Parameters:
logicalOperator- The logical operator applied to the set (ANDorOR).- Returns:
- The new expression set created and added.
-
addExpression
Add an expression in this expression set.- Parameters:
expression- an expression created through IDfExpressionSet methods or through DfExpressionFactory
-
getLogicalOperator
int getLogicalOperator()Gets the logical operator applied between each expression of this set.- Returns:
- The logical operator (either
LOGICAL_OP_ANDorLOGICAL_OP_OR). - See Also:
-
setLogicalOperator
void setLogicalOperator(int logicalOperator) Sets the logical operator applied between each expression of this set.- Parameters:
logicalOperator- The logical operator (eitherLOGICAL_OP_ANDorLOGICAL_OP_OR).- See Also:
-
setDistance
Sets the positional operator used to run proximity search. This distance will be used only if the expression set contains IDfFulltextExpression objects (at least 2). Proximity searches are only supported when the DFC search service generates xQuery.- Parameters:
positionalOperator- bean containing the constraints to define the proximity search
-
getDistance
PositionalOperator getDistance()Get the proximity operator used to run proximity search..- Returns:
- the proximity operator
-