IBM Information Integrator for Content V8.2 APIs

com.ibm.mm.beans.infomining
Class CMBAdvancedSearchService

java.lang.Object
  |
  +--com.ibm.mm.beans.infomining.CMBInfoMiningBean
        |
        +--com.ibm.mm.beans.infomining.CMBConnectedMiningBean
              |
              +--com.ibm.mm.beans.infomining.CMBAdvancedSearchService
All Implemented Interfaces:
com.ibm.mm.beans.CMBConnectionReplyListener, java.util.EventListener, java.io.Serializable

public class CMBAdvancedSearchService
extends CMBConnectedMiningBean

The CMBAdvancedSearchService is a non-visual bean that performs a text search on records in the Information Mining catalog.

   Properties and Events Overview:

   pre-conditions         open server connection
   properties (default)   catalogName ("")
                          queryString ("")
                          maxResults (0)
                          pageSize (10)
                          traceEnabled (false)
   bound properties       none
   constrained properties none
   event target for       CMBConnectionReplyEvent
   event source for       CMBResultEvent
                          CMBExceptionEvent
                          CMBTraceEvent

 

See Also:
Serialized Form

Constructor Summary
CMBAdvancedSearchService()
          Constructs a new CMBAdvancedSearchService.
 
Method Summary
 void addCMBResultListener(com.ibm.mm.beans.CMBResultListener l)
          Adds the specified result listener so that result events can be received from this information mining bean.
static java.lang.String convertWebQuery(java.lang.String webQuery)
          Converts a query using unitary '+' and '-' operators to a value that can be used as a CONTAINS value.
 java.lang.String getCatalogName()
          Returns the current catalog name.
 java.lang.String[] getKeysToBeFetched()
          Returns the currently set keys whose associated values are to be retrieved for the records found.
 int getMaxResults()
          Returns the maximum number of search results returned from each query.
 int getPageSize()
          Returns the number of search results in one result page.
 java.lang.String getQueryString()
          Returns the current query.
 void removeCMBResultListener(com.ibm.mm.beans.CMBResultListener l)
          Removes the specified result listener so that it no longer receives result events from this information mining bean.
 void runQuery()
          Performs a search using the current query.
 void setCatalogName(java.lang.String catalogName)
          Sets the name of the catalog to be searched.
 void setKeysToBeFetched(java.lang.String[] recordKeys)
          Sets the keys of the values to be retrieved for the records found.
 void setMaxResults(int maxResults)
          Sets the maximum number of search results returned from each query.
 void setPageSize(int pageSize)
          Sets the number of search results in one result page.
 void setQueryString(java.lang.String queryString)
          Sets the query.
 
Methods inherited from class com.ibm.mm.beans.infomining.CMBConnectedMiningBean
getConnection, isConnected, onCMBConnectionReply, setConnection, validateConnection
 
Methods inherited from class com.ibm.mm.beans.infomining.CMBInfoMiningBean
addCMBExceptionListener, addCMBTraceListener, isTraceEnabled, removeCMBExceptionListener, removeCMBTraceListener, setTraceEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CMBAdvancedSearchService

public CMBAdvancedSearchService()
Constructs a new CMBAdvancedSearchService.
Method Detail

setCatalogName

public void setCatalogName(java.lang.String catalogName)
Sets the name of the catalog to be searched.
Parameters:
catalogName - the catalog name
See Also:
getCatalogName()

getCatalogName

public java.lang.String getCatalogName()
Returns the current catalog name.
Returns:
the catalog name
See Also:
setCatalogName(String)

setQueryString

public void setQueryString(java.lang.String queryString)
Sets the query.
The query syntax looks like:
 query_string         ::= term
 term                 ::= ( term )
                      ::= single_term
                      ::= compound_term
 single_term          ::= category_term
                      ::= text_search_term
                      ::= string_term
                      ::= number_term
 compound_term        ::= term binary_bool_operator term
                      ::= unary_bool_operator single_term
 category_term        ::= ( DKIKFCategory category_operator category_path_value )
 text_search_term     ::= ( "attribute name" CONTAINS text_search_value )
 string_term          ::= ( "attribute name" string_operator string_value )
 number_term          ::= ( "attribute name" basic_operator number_value )
 binary_bool_operator ::= AND | OR
 unary_bool_operator  ::= NOT
 category_operator    ::= >= | =
 string_operator      ::= LIKE | basic_operator
 basic_operator       ::= > | < | <= | >= | != | =
 category_path_value  ::= "category path"
 text_search_value    ::= "'string'"
 string_value         ::= "string"
 number_value         ::= "integer" | "decimal number"
 
Example:

("IKF_CONTENT" CONTAINS "'bird'") AND (DKIKFCategory = "root/nature")

Parameters:
queryString - the query string built according to the syntax described above.
See Also:
convertWebQuery(java.lang.String), runQuery(), getQueryString()

getQueryString

public java.lang.String getQueryString()
Returns the current query.
Returns:
the current query
See Also:
setQueryString(String)

setMaxResults

public void setMaxResults(int maxResults)
Sets the maximum number of search results returned from each query. If 0 is specified the query will result in as much results as possible.
Parameters:
maxResults - maximum number of search results
See Also:
getMaxResults()

getMaxResults

public int getMaxResults()
Returns the maximum number of search results returned from each query.
Returns:
the maximum number of search results
See Also:
setMaxResults(int)

setPageSize

public void setPageSize(int pageSize)
Sets the number of search results in one result page.
Parameters:
pageSize - number of search results in one result page
See Also:
getPageSize()

getPageSize

public int getPageSize()
Returns the number of search results in one result page.
Returns:
the number of search results in one result page
See Also:
setPageSize(int)

setKeysToBeFetched

public void setKeysToBeFetched(java.lang.String[] recordKeys)
Sets the keys of the values to be retrieved for the records found.
Parameters:
recordKeys - keys whose associated values are to be retrieved

getKeysToBeFetched

public java.lang.String[] getKeysToBeFetched()
Returns the currently set keys whose associated values are to be retrieved for the records found.
Returns:
the keys of the values to be retrieved

convertWebQuery

public static java.lang.String convertWebQuery(java.lang.String webQuery)
                                        throws CMBWebQuerySyntaxException
Converts a query using unitary '+' and '-' operators to a value that can be used as a CONTAINS value. The BNF for a query string looks like:
 query string ::= qterms qterm qterms
 qterm        ::= [operator] term
 operator     ::= '+' | '-' | '  '
 
A term may be a single word, a hyphen term (e.g. e-mail), or a phrase that must be rendered with quotations marks (e.g. "human resources").

The '+' terms must occur in the result set, the '-' terms must not. Terms without any operators may occur.

See Also:
setQueryString(String)

runQuery

public void runQuery()
              throws com.ibm.mm.beans.CMBNoConnectionException,
                     CMBNoSuchCatalogException
Performs a search using the current query.
Throws:
com.ibm.mm.beans.CMBNoConnectionException - if not connection has been established
CMBNoSuchCatalogException - if the specified catalog name is not valid
See Also:
setQueryString(String), setCatalogName(String)

addCMBResultListener

public void addCMBResultListener(com.ibm.mm.beans.CMBResultListener l)
Adds the specified result listener so that result events can be received from this information mining bean.
Parameters:
l - the result listener
See Also:
removeCMBResultListener(CMBResultListener)

removeCMBResultListener

public void removeCMBResultListener(com.ibm.mm.beans.CMBResultListener l)
Removes the specified result listener so that it no longer receives result events from this information mining bean.
Parameters:
l - the result listener
See Also:
addCMBResultListener(CMBResultListener)


IBM Information Integrator for Content V8.2 APIs

© Copyright International Business Machines Corporation 1996, 2003 IBM Corp. All rights reserved.