search

Top  Previous  Next

search

o=new("search"[,searchid$])

 

The search object provides programmable control over the library search function offered by the browser interface and the command line -arcsearch option.  By setting selected properties to values that follow the search syntax requirements, and running the search, a document list object is created that provides access to the results of the search.  In addition, the results can be placed on a user's search results page, so a rule set can execute a search on behalf of a user, and the results can be displayed in the browser interface.

 

If a searchid$ is supplied, then the search object opens an existing search result, and the doclist object is attached to those results.  This feature is useful when using custom browser forms driven from a search screen, as the search ID is provided and the search results the user generated can be accessed in a rule set.  The search ID is the "sid" field value found in the  URL of a search result screen, and is always a 10-digit value.

 

Each of the properties can be set to a wildcard (i.e. "*value*" or "value*"), an exact value (i.e. "12345"), a range (i.e. "12/1/2007--12/31/2007" - two dashes), or a regular expression with a tilde prefix (i.e. "~[0-9][A-Z]").  You can use "not" or "!" to look for archives that do not match a criteria, and "and"( or a semicolon) or "or" (or a comma), to search for multiple values or alternate values.  All properties that are set must evaluate to true for a document to be added to the document list.

 

Searches are optimized when possible.  The best optimizations are document IDs, entity IDs, small date ranges, and multi-level categories.

 

Note that document types and document IDs are case-sensitive when optimized.

 

Properties

docdata$ specifies one or more name=value settings, separated by semi-colons (for AND logic) or commas (for OR logic).

docid$ specifies document ID(s) to search for.  Note that document IDs are case-sensitive.

doclist is a document list object that is filled with search results when the run method is executed.

doctype$ specifies document type(s) to search.  Note that document types are case-sensitive.

filter$ is compared to all document properties.

library$ contains one or more library names to search.  Multiple libraries can be separated by semicolons.

recsread is a read-only property that stores the number of records read when the search was last run.

selected is a read-only property that stores the number of records selected and added to the document list object when the search was last run.

subids$ searches for documents that contain the subid(s) specified.

text$ searches the contents of the @text subdocument, if found, for the text$ search criteria.

title$, date$, dateupdated$, entityid$, keywords$, notes$, categories$, and links$ specify criteria for a given document property.  Dates can be specified in yyyymmdd[hhmmss] format, or in local delimited date format, such as "12/31/2009", where the mdy order is configured with datefmt=xxx in uf101d.ini.

 

 

Methods

makesearch(userid$[,description$[,errmsg$]) saves the search results in the user's search results table, so the browser interface will have access to the results.  Optionally specify the description, or an error message, which will appear in the table.

run([append]) runs the search and fills the doclist object.  If append is true (1), then the doclist object is not cleared before running.  This allows multiple searches to produce a combined document list.