Application Programming Interface Guide > Built-in Procedures > Procedures Reference > Search
 
Search
This is a packaged query used to perform a free text search in the TDV metadata. The search is performed across TDV resources such as datasources, tables, procedures, folders, catalogs, schemas and flows. Details that are fetched as search results include details about the resource - resource id, name, type, the field type (name/annotation/column/parameter/definition), contents of the matching field types, the parent name, id and path and the field type rank. Web service operations are also searched as part of the procedure.
Location
/lib/resource/
Inputs
 
Name
Datatype
Null
Description
query
LONGVARCHAR
Yes
When the specified query is null or empty, no results will be returned. Search text can be single or multi-word. When multiple words are specified, results contain records matching any/all the words.
fieldTypeFilter
LONGVARCHAR
Yes
When specified fieldTypeFilter is null or empty, all field types are matched for. Field type filter can be a single type filter or multiple comma-separated allowable values. The allowed values for this are "name", "annotation", "column", "parameter" and "definition". This input allows for search to be restricted to the specified comma-separated list of field types. Field type names are not case-sensitive.
resourceTypeFilter
LONGVARCHAR
Yes
When specified resourceTypeFilter is null or empty, all resource types are matched for. Resource type filter can be a single filter or multiple comma-separated allowable values. The allowed values for this are "datasource", "table", "procedure" , "folder", "catalog", "schema" and "flow". This input allows for search to be restricted to the specified comma-separated list of resource types. Resource type names are not case-sensitive.
annotateResult
BIT
Yes
Default value is 0. Allowed values are 0 and 1. When set to 1, results are annotated with the specified or default markers in "startMarker" and "stopMarker".
startMarker
VARCHAR
Yes
Used for annotating the start of the result. The default value is "<b>".
stopMarker
VARCHAR
Yes
Used for annotating the end of the result. The default value is "</b>".
reportDataFlows
BIT
Yes
Default value is 0. Allowed values are 0 and 1. When set to 1, resource_type in results will be “Flow” if the specific folder/view/sql script were created from WebUI as a flow. When null or 0, the matching folder/view/sql script though created as flows from WebUI will show up as their original resource types respectively.
nameRankWeight
INTEGER
Yes
This parameter is used for designating rank weight to "name" field type. When unspecified, the rank weight for the "name" field type is defaulted to 10.
annotationRankWeight
INTEGER
Yes
This parameter is used for designating rank weight to "column" and "parameter" field types. When unspecified, the rank weight for the "column" and "parameter" field types is defaulted to 5.
definitionRankWeight
INTEGER
Yes
This parameter is used for designating rank weight to "definition" field type. When unspecified, the rank weight for the "definition" field type is defaulted to 2.
Outputs
The result output is a cursor. The rows encode resources matching the search query under the specified conditions, having the following columns
resourceId : The id of the resource.
resourceName : The name of the resource.
resourceType : The resource type.
matchingFieldTypes : The types of the resource fields, delimited by the character “\”, matching the search term. Example : name\column\definition
matchingFieldContents : The contents of the matching fields, within single quotes and delimited by the character “\”, listed in the same order as the value of matchingFieldTypes.
parentDatasource : The name of the parent data source of the matching resource. Applicable only to resources that are contained within a data source.
parentDatasourceId : The id of the parent data source of the matching resource. Applicable only to resources that are contained within a data source.
parentPath : The parent path of the matching resource.
rank : The search rank of the result. This is the sum of all field types ranks for the matching resource.