Prepares a search results using given criteria in xml format.

Syntax

Visual Basic (declaration)
Public Function Search( _ 
ByVal AuthenticationTicket as String, _ ByVal xmlcriteria as String, _ ByVal SortBy as String, _ ByVal AscendingOrder as bool) as XmlNode

C# (declaration)
public XmlNode Search( 
string AuthenticationTicket, string xmlcriteria, string SortBy, bool AscendingOrder)

Parameters

AuthenticationTicket
    string infoRouter ticket
xmlcriteria
    string The xml structure of the criterias. To Details of this parameter see the remarks section.
SortBy
    string Possible Sort Options : DOCUMENTNAME, DOCUMENTSIZE, MIMETYPEDESCRIPTION, MODIFICATIONDATE, STATUSCODE, FOLDERNAME, LASTVERSIONNUMBER, PERCENTCOMPLETE, CREATIONDATE, MODIFIEDBYNAME, DESCRIPTION, OWNERNAME, FLOWNAME, VIEW, CHECKEDOUTBYNAME, COMPLETIONDATE, IMPORTANCE, RETAINUNTIL, CLEVEL, DECLASSIFYON, DOWNGRADEON, DISPOSITIONDATE, LASTISOREVIEW, NEXTISOREVIEW
AscendingOrder
    bool Boolean value can be true or false

Return Value

returns xml fragment.
<response success="true" error="" ranksorted="False">
if success attribute is "true", the search result has been prepared successfully.
if success attribute is "false", the error attribute indicates the encountered error.
if ranksorted attribute is "true" the results are always ordered by rank.
This occurs in cases where keyword criteria are specified.

Remarks

The Search Criteria XML fragment should be as described below.

<SEARCH>
<ITEM NAME="SEARCHSCOPE" VALUE="" />
<ITEM NAME="KEYWORDS" VALUE="" />
<ITEM NAME="DOCUMENTNAME" VALUE="" />
<ITEM NAME="DOCUMENTID" VALUE="" />
<ITEM NAME="FOLDERDESCRIPTION" VALUE="" />
<ITEM NAME="DOCUMENTFORMAT" VALUE="" />
<ITEM NAME="USERNAME" VALUE="" />
<ITEM NAME="FOLDER" VALUE="" />
<ITEM NAME="CHECKOUTSTATUS" VALUE="" />
<ITEM NAME="DATECRITERIA" SUBTYPE="" OPERATOR="" VALUE="" />
<ITEM NAME="SIZEIS" OPERATOR="" VALUE="" />
<ITEM NAME="IMPORTANCE" OPERATOR="" VALUE="" />
<ITEM NAME="CLEVEL" VALUE="" />
<ITEM NAME="DOCUMENTTYPE" VALUE="" />
<ITEM NAME="VIEWCRITERIA" VALUE="" />
<ITEM NAME="DOCSRC" VALUE="" />
<ITEM NAME="DOCLANG" VALUE="" />
<ITEM NAME="DOCAUTHOR" VALUE="" />
<ITEM NAME="PROPERTYSETNAME" VALUE="">
<ATTR NAME="" OPERATOR="" VALUE="" />
</ITEM>
</SEARCH>

criteria details

SEARCHSCOPE

ONLINE - Online Only
ALL - All Documents
ARCHIVE - Archive Only
ONLINE-HIDDENS - Online including Hiddens

if this parameters not specified all documents will be searched.

KEYWORDS : One or more keywords. This will invole a content (full-text) search.

DOCUMENTNAME : Name of the document. You may use an asterisk (*) to indicate that you have specified a partial document name.
such as
Acc*
*ing.doc
*.doc

DOCUMENTID: The ID of the document

FOLDERDESCRIPTION: The description of the folder.

DOCUMENTFORMAT: The format of the document. "DOCUMENTTYPE" is absolute used in Version 7.0
Possible pre-defined document formats are "Image", "Video", "Sound", "Office Document", "Internet Document", "Cascade Style Sheet", "Help File", "email message", "Compressed File", "Programming", "Plain Text", "Application", "Document Shortcut", "Internet Link", "XML Document"

Usage:
<ITEM NAME="DOCUMENTFORMAT" VALUE="Image,Sound" />

this criteria uses Mime type definitions specified in the inforouter control panel.



OBJECTTYPENAME: The options may be "FOLDERSONLY" or "DOCUMENTSONLY".

DOCTYPE


USERNAME : The name (username) of the user who owns the documents or folders to be returned.

FOLDER : Specify a folder path if you wish to limit your search to a specific path.

CHECKOUTSTATUS :
CHECKEDOUT - Restrict search to the CHECKED OUT documents
NOTCHECKEDOUT - Restrict search to the NOT CHECKED OUT documents

DATECRITERIA : Use this to restrict your search to a date criteria. See types below.

<ITEM NAME="DATECRITERIA" SUBTYPE="" OPERATOR="" VALUE="" />

the SUBTYPE attribute can be

CREATED : Date Created
MODIFIED : Date Modified
CREATED OR MODIFIED : Created Or Modified
RETAIN UNTIL : Retain Until
COMPLETED ON : Completed On
DECLASSIFY ON : Declassify On
DOWNGRADE ON : Downgrade On
LAST ISO REVIEW DATE : Last ISO Review Date
NEXT ISO REVIEW DATE : Next ISO Review Date
DISPOSITION DATE : Destroy Date

The Operator attribute can be
EQ
EQGT
EQLT


The Value attibute must be a date value in the Universal date format like 2005-04-23

- search in to documents created before 1 feb 2005
<ITEM NAME="DATECRITERIA" SUBTYPE="CREATED" OPERATOR="EQLT" VALUE="2005-02-01"/>


SIZEIS: Specify this parameter if you wish to limit your search to documents of a certain size.

OPERATOR can be
EQGT for at least
EQLT for at most

VALUE Attibute can be any integer value in the form of kilobytes

example:

<ITEM NAME="SIZEIS" OPERATOR="EQLT" VALUE="1024" /> searchs the documents smaller than 1 mb
<ITEM NAME="SIZEIS" OPERATOR="EQGT" VALUE="512" /> searchs the documents bigger than 512 kb

IMPORTANCE: Specify this parameter if you wish to limit your search to documents that are marked with a level of importance.

VALUE Attibute can be
LOW
NORMAL
HIGH
VITAL

OPERATOR attribute can be
EQ : Equal
EQGT : At least
EQLT : At most

example:

<ITEM NAME="IMPORTANCE" OPERATOR="EQ" VALUE="HIGH" /> searches the documents exacty set the high importance
<ITEM NAME="IMPORTANCE" OPERATOR="EQGT" VALUE="HIGH" /> searches the high importance or vital documents

CLEVEL: Specify this parameter if you wish to limit your search to documents that have a classification attribute set.

VALUE Attibute can be

NOMARKINGS - No Markings
DECLASSIFIED - Declassified
CONFIDENTIAL - Confidential
SECRET - Secret
TOPSECRET - Top Secret


VIEWCRITERIA: Specifies the documents view state for the search
Value attribute can be
NOVIEW : Documents the caller has not viewed
UPDATED : Viewed but Updated Documents</option>
SAW : Viewed but Unchanged documents

DOCSRC: The source of the document.
DOCLANG : The language of the document
DOCAUTHOR : The Author of the document


PROPERTYSETNAME: XML fragment specifies the documents property set values
Value attribute can be any Property set name defined in inforouter
The sub items in this node defines the attribute names, operator and the value.

<ITEM NAME="PROPERTYSETNAME" VALUE="ADDRESS">
<ATTR NAME="ADDRESSTYPE" OP="EQ" VALUE="HOME" />
<ATTR NAME="STATE" OPERATOR="EQ" VALUE="NY" />
</ITEM>
The xml fragment above restrics the search results to the ADDRESS property set applied to documents or folders. And the address type must be HOME address and STATE field must be NY.

The OPERATOR list:

DATE Datatype
ANYTIME,
YESTERDAY,
TODAY,
LAST7DAYS,
NEXT7DAYS,
LASTWEEK,
THISWEEK,
NEXTWEEK,
LASTMONTH,
THISMONTH,
NEXTMONTH,
EQ (requires a date value),
EQGT (requires a date value),
EQLT (requires a date value),
NULL,

NUMBER Data type
EQ (requires a number value)
NOTEQ (requires a number value)
EQLT (requires a number value)
EQGT (requires a number value)
GT (requires a number value)
LT (requires a number value)
NOTNULL,
NULL

CHAR Data type
LIKE (requires a string value)
EQ (requires a string value)
NULL,
NOTNULL,

BOOLEAN data type
EQ (requires a Boolean(TRUE,FALSE) value)
NOTNULL
NULL

minus gif Example

Visual Basic Example
Sub Search_sample()
        Const IRAuthenticationTicket as string="sid-xxxxxxxxxxxxxxx"
        Const Keywords as string="apple and pears"

        Dim IR_OBJ As InfoRouter.srv
        Dim xmlsearchcriteriadoc As System.Xml.XmlDocument
        Dim xmlcriteria As System.Xml.XmlElement
        Dim xmlResponse As System.Xml.XmlElement

        Try
            xmlsearchcriteriadoc = New System.Xml.XmlDocument
            xmlsearchcriteriadoc.LoadXml("<search/>")

            xmlcriteria = xmlsearchcriteriadoc.CreateElement("ITEM")
            xmlcriteria.SetAttribute("NAME", "SEARCHSCOPE")
            xmlcriteria.SetAttribute("VALUE", "ONLINE")
            xmlsearchcriteriadoc.DocumentElement.AppendChild(xmlcriteria)

            xmlcriteria = xmlsearchcriteriadoc.CreateElement("ITEM")
            xmlcriteria.SetAttribute("NAME", "KEYWORDS")
            xmlcriteria.SetAttribute("VALUE", Keywords)
            xmlsearchcriteriadoc.DocumentElement.AppendChild(xmlcriteria)

            ClearOutputWindow()
            Application.DoEvents()
            Me.ActiveForm.Cursor = Cursors.WaitCursor

            IR_OBJ = New InfoRouter.srv
            IR_OBJ.Url = (txtSrvUrl.Text & "/srv.asmx")

            xmlResponse = IR_OBJ.Search(IRAuthenticationTicket , _
                                        xmlsearchcriteriadoc.OuterXml, _
                                        1, True)
            If xmlResponse.GetAttribute("success") = "true" Then
                WriteOutputLine("The search prepared successfully.")


            Else
                WriteOutputLine("The search cannot be prepared.")
                WriteOutputLine("server response:" & xmlResponse.GetAttribute("error"))
            End If
            xmlResponse = Nothing

        Catch ex As Exception
            WriteOutputLine("error:" & ex.Message)
        Finally
            IR_OBJ = Nothing
            Me.ActiveForm.Cursor = Cursors.Default
        End Try
End Sub