Content Management and Capture

Expand all | Collapse all

Search multiple doc clases with the API

  • 1.  Search multiple doc clases with the API

    Posted Tue February 16, 2021 07:52 AM
    Can anyone provide guidance on how to search across multiple document classes using the SearchScope object?

    ------------------------------
    Tom DeLuca
    ------------------------------


  • 2.  RE: Search multiple doc clases with the API

    Posted Wed February 17, 2021 04:41 AM
    Seems like you're asking two largely orthogonal questions, how (i.e. using what CE SQL) do I search across multiple document classes, and how do I do searches (generally) programmatically (using SearchScope).

    On the first part, a query of the Document base class (as in 'SELECT ... FROM Document WHERE ...) is by default a search across all document classes (refer to documentation of the INCLUDESUBCLASSES option), which may be all you need. For more nuanced inclusion of specific subclasses, the IsClass and IsOfClass WHERE clause expressions will be of use. Refer to https://www.ibm.com/support/knowledgecenter/SSNW2F_5.5.0/com.ibm.p8.ce.dev.ce.doc/query_sql_syntax_ref.htm and adjacent topics.

    On the second part, https://www.ibm.com/support/knowledgecenter/SSNW2F_5.5.0/com.ibm.p8.ce.dev.ce.doc/query_procedures.htm provides sample code.

    ------------------------------
    Mike
    ------------------------------



  • 3.  RE: Search multiple doc clases with the API

    Posted Wed February 17, 2021 06:58 AM
    Hi Tom,

    try something like this in your SQL. "SELECT DocumentTitle, isCurrentVersion FROM Document D WHERE (IsClass(D,SymbolicNameOfClass1) OR IsClass(D,SymbolicNameOfClass2))".

    Rickie

    PS: If you want search in subclasses too, replace "IsClass" with IsOfClass"

    ------------------------------
    Richard Siegl
    ------------------------------



  • 4.  RE: Search multiple doc clases with the API

    Posted Wed February 17, 2021 06:59 AM
    Hi Tom,

    try this in your SQL. "... DocumentTitle, isCurrentVersion FROM Document D WHERE (IsClass(D,SymbolicNameOfClass1) OR IsClass(D,SymbolicNameOfClass2)) AND ..."

    Rickie

    ------------------------------
    Richard Siegl
    ------------------------------



  • 5.  RE: Search multiple doc clases with the API

    Posted Wed February 17, 2021 03:47 PM
    Thanks everyone!  @Richard Siegl, your suggestion was spot on... @Michael Seaman, thank you for the link to the SQL Syntax Reference.  I didn't know that existed until today :)
    ​​​​

    ------------------------------
    Tom DeLuca
    ------------------------------