public abstract class RMContentSearchDefinition
extends java.lang.Object
implements java.lang.Cloneable
RMSearch.contentBasedRetrieval
method
to conduct the CBR search.
This class defines the following fields:
OrderBy.metadata
to indicate the search results are ordered by a metadata property such as DocumentTitle, or
OrderBy.cbrscores
to indicate the search results are ordered by CBR scores.SortOrder.asc
for the ascending order or SortOrder.desc
for descending or SortOrder.none
for no ordering.OrderBy.metadata
is specified in the order by field.
If OrderBy.cbrscores
is specified, this field is ignored.AndOrOper.and
or AndOrOper.or
.AndOrOper.or
and orderBy set to OrderBy.metadata
. In other cases, this field is ignored.
true
if there is no other metadata criteria, which means this is a CBR condition only; otherwise false
.Modifier and Type | Class and Description |
---|---|
static class |
RMContentSearchDefinition.AndOrOper
Defines an enumeration type of and/or operator.
|
static class |
RMContentSearchDefinition.ContentSearchOption
Defines cbr search on content or on property
|
static class |
RMContentSearchDefinition.OrderBy
Defines an enumeration type of order by: either by metadata, by CBR scores or no order.
|
static class |
RMContentSearchDefinition.SortOrder
Defines an enumeration type of sort order possibilities.
|
Constructor and Description |
---|
RMContentSearchDefinition()
Default constructor
|
RMContentSearchDefinition(java.lang.String selectClause,
java.lang.String fromClause,
java.lang.String whereClause,
java.lang.String orderClause,
java.lang.String sqlAlias,
java.lang.String content,
RMContentSearchDefinition.SortOrder sortOrder,
RMContentSearchDefinition.OrderBy orderBy,
boolean cbrConditionOnly)
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
buildContentQueryStmt()
Abstract method to build the CBR search SQL statement.
|
abstract java.lang.String |
buildContentQueryStmt(java.util.List<java.lang.String> idList,
boolean bRankSort)
Abstract method to build the CBR search SQL statement to search for documents with the given document ID lists.
|
java.lang.String |
buildSQLStmt()
Build the metadata search SQL statement based on the data in this search definition.
|
java.lang.String |
buildSQLStmtFromCommonCriteria()
Build the metadata search SQL statement using the where clause for common criteria.
|
java.lang.Object |
clone()
This is to override the
clone() method to clone another RMContentSearchDefinition object. |
static RMContentSearchDefinition |
createInstance(RMDomain rmDomain)
Create an instance of concrete class that extends this abstract class based on the specified
RMDomain . |
java.lang.String |
getCommonWhereClause()
Get the where clause for common criteria.
|
java.lang.String |
getContentSearch()
Get content search keyword(s)
|
RMContentSearchDefinition.ContentSearchOption |
getContentSearchOption()
Get cbr search option between the content and property search.
|
java.lang.String |
getFromClause()
Get the from clause.
|
RMContentSearchDefinition.AndOrOper |
getOperBtwContentAndMetadataSearch()
Get operator between the content and metadata search.
|
RMContentSearchDefinition.OrderBy |
getOrderBy()
Indicates if the search is ordered by metadata, by CBR scores, or no order.
|
java.lang.String |
getOrderClause()
Get the order clause.
|
java.lang.String |
getSelectClause()
Get the select clause.
|
RMContentSearchDefinition.SortOrder |
getSortOrder()
Get the sorting order
|
java.lang.String |
getSqlAlias()
Get the SQL alias of record class
|
java.lang.String |
getWhereClause()
Get the where clause.
|
abstract boolean |
hasContentQueryDefined()
This method returns true if there is content Search keyword(s) presented.
|
boolean |
isCBRConditionOnly()
Indicates if this content search definition contains CBR conditions only.
|
void |
setCBRConditionOnly(boolean isCBRConditionOnly)
Set a boolean to indicate this content search definition contains CBR conditions only.
|
void |
setCommonWhereClause(java.lang.String commonWhereClause)
Set the where clause for common criteria.
|
void |
setContentSearch(java.lang.String contentSearch)
Set content search keyword(s)
|
void |
setContentSearchOption(RMContentSearchDefinition.ContentSearchOption option)
Set cbr search option between the content and property search.
|
void |
setFromClause(java.lang.String fromClause)
Set the from clause.
|
void |
setOperBtwContentAndMetadataSearch(RMContentSearchDefinition.AndOrOper operBtwContentAndMetadataSearch)
Set operator between the content and metadata search.
|
void |
setOrderBy(RMContentSearchDefinition.OrderBy orderBy)
Set the value to indicate the search is ordered by metadata, by CBR scores, or no order.
|
void |
setOrderClause(java.lang.String orderClause)
Set the order clause.
|
void |
setSelectClause(java.lang.String selectClause)
Set the select clause.
|
void |
setSortOrder(RMContentSearchDefinition.SortOrder sortOrder)
Set the sorting order
|
void |
setSqlAlias(java.lang.String sqlAlias)
Set the SQL alias of record class
|
void |
setWhereClause(java.lang.String whereClause)
Set the where clause.
|
public RMContentSearchDefinition()
public RMContentSearchDefinition(java.lang.String selectClause, java.lang.String fromClause, java.lang.String whereClause, java.lang.String orderClause, java.lang.String sqlAlias, java.lang.String content, RMContentSearchDefinition.SortOrder sortOrder, RMContentSearchDefinition.OrderBy orderBy, boolean cbrConditionOnly)
selectClause
- a String
of select clause.fromClause
- a String
of from clause.whereClause
- a String
of where clause.orderClause
- a String
of order clause.sqlAlias
- a String
to specify the SQL alias of record class.content
- a String
of content search keyword(s).sortOrder
- a RMContentSearchDefinition.SortOrder
value to specify the sort order.orderBy
- a RMContentSearchDefinition.OrderBy
value to specify order by metadata, by CBR scores, or none.cbrConditionOnly
- a boolean
to specify where or not it is CBR condition only.public java.lang.String getCommonWhereClause()
String
of the where clause for common criteria.public void setCommonWhereClause(java.lang.String commonWhereClause)
commonWhereClause
- a String
of the where clause for common criteria.public static RMContentSearchDefinition createInstance(RMDomain rmDomain)
RMDomain
.rmDomain
- a RMDomain
value.public boolean isCBRConditionOnly()
true
if it is a CBR condition only, otherwise false
.public void setCBRConditionOnly(boolean isCBRConditionOnly)
isCBRConditionOnly
- true
if it is a CBR condition only, false
otherwise.public java.lang.String getSelectClause()
String
value.public void setSelectClause(java.lang.String selectClause)
selectClause
- a String
value.public java.lang.String getFromClause()
String
value.public void setFromClause(java.lang.String fromClause)
fromClause
- a String
value.public java.lang.String getWhereClause()
String
value.public void setWhereClause(java.lang.String whereClause)
whereClause
- a String
value.public java.lang.String getOrderClause()
String
value.public void setOrderClause(java.lang.String orderClause)
orderClause
- a String
value.public java.lang.String getSqlAlias()
String
value.public void setSqlAlias(java.lang.String sqlAlias)
sqlAlias
- a String
value.public RMContentSearchDefinition.AndOrOper getOperBtwContentAndMetadataSearch()
RMContentSearchDefinition.AndOrOper
value.public void setOperBtwContentAndMetadataSearch(RMContentSearchDefinition.AndOrOper operBtwContentAndMetadataSearch)
operBtwContentAndMetadataSearch
- an RMContentSearchDefinition.AndOrOper
value.public RMContentSearchDefinition.ContentSearchOption getContentSearchOption()
RMContentSearchDefinition.ContentSearchOption
value.public void setContentSearchOption(RMContentSearchDefinition.ContentSearchOption option)
option
- an RMContentSearchDefinition.ContentSearchOption
value.public java.lang.String getContentSearch()
String
value.public void setContentSearch(java.lang.String contentSearch)
contentSearch
- a String
value.public RMContentSearchDefinition.SortOrder getSortOrder()
RMContentSearchDefinition.SortOrder
value.public void setSortOrder(RMContentSearchDefinition.SortOrder sortOrder)
sortOrder
- a RMContentSearchDefinition.SortOrder
value.public RMContentSearchDefinition.OrderBy getOrderBy()
RMContentSearchDefinition.OrderBy
value.public void setOrderBy(RMContentSearchDefinition.OrderBy orderBy)
orderBy
- an RMContentSearchDefinition.OrderBy
value.public java.lang.String buildSQLStmt()
String
of metadata search SQL statement.public java.lang.String buildSQLStmtFromCommonCriteria()
operBtwContentAndMetadataSearch
is set to
AndOrOper.or
and orderBy
is set to OrderBy.metadata
.String
of metadata search SQL statement.public java.lang.Object clone()
clone()
method to clone another RMContentSearchDefinition object.clone
in class java.lang.Object
RMContentSearchDefinition
object.public abstract java.lang.String buildContentQueryStmt()
String
of CBR search SQL statement.public abstract java.lang.String buildContentQueryStmt(java.util.List<java.lang.String> idList, boolean bRankSort)
idList
- a List
of String
of document GUIDs.bRankSort
- If true, the returned SQL statement contains "ORDER BY Rank". If false, the SQL does not contain "ORDER BY Rank".
The performance is faster without "ORDER BY Rank".String
of CBR search SQL statement.public abstract boolean hasContentQueryDefined()
true
to indicate there is a content Search defined.© Copyright IBM Corp. 2010, 2013. All Rights Reserved.