Previous Topic: read-req Command—Read an Entry

Next Topic: search-req-filter

search-req Command—Find Entries

The search-req command finds entries within a namespace partition.

The search service can return many objects. If the search exceeds a size limit or a time limit, or if the DUA receives an abandon request, the search returns partial results, that is, the entries that it collected before being stopped.

The search is successful if it can find its base object.

The search detects if an alias directly or indirectly points to itself, and returns an error.

The command has the following format:

search-req
	base-object = DN
	[one-level-only | base-object-only | whole-subtree]
	[filter = { search-req-filter }]
	[no-info-return]
	[dont-search-aliases | search-aliases]
	[attr-only | attr-and-val]
	[all-attrs | attrs = attribute [,attribute...]]
	[common-args]
	;
base-object = DN

Defines the distinguished name of the entry at which the search starts. DN is expressed in X.500 format.

one-level-only | base-object-only | whole-subtree

(Optional) Specifies the scope of the search.

The default is base-object-only.

{search-req-filter }

Specifies a filter for the search. The braces are part of the command. For more information about its syntax, see search-req-filter.

no-info-return

(Optional) Returns only the names of the entries that satisfy the filter.

dont-search-aliases

(Optional) Specifies that search-req should not follow the aliasedObjectname of an alias. If this is not specified, search-req treats aliases as pointers to entries.

attrs = attribute [,attribute...]

(Optional) Returns only the specified attributes.

common-args

Defines the common arguments. For more information, see common-args.

Example: Search Service for One Entry

The following example is equivalent to a read-req. It retrieves all attributes and values of one entry:

search-req
	base-object =	<countryName "AU">
	<organizationName "Democorp">;

Example: Search Service for Single Level

The following example is equivalentg to a list-req. It retrieves the names of all objects from one level under Democorp:

search-req
	base-object =	<countryName "AU">
	<organizationName "Democorp">
	one-level-only
	no-info-return;

Example: Search Service for Subtree

The following example searches all entries under Democorp, including Democorp. It retrieves all information about every entry that contains an attribute surname with the value Smith:

search-req
	base-object =	<countryName "AU">
		<organizationName "Democorp">
	whole-subtree
	filter = { attr = surname value = "Smith" };

Example: Search Service for Local Directory Tree

Search the local directory tree, retrieving all objects that contain a surname attribute with a value of Smith and a title attribute with a value of Manager and a telephoneNumber attribute. Retrieve only the commonName, surname, and telephoneNumber attributes of the objects matching the search filter.

search-req
	base-object = <>
	whole-subtree
	filter = { and {attr = surname value = "Smith",
		attr = title substrings [ any "Manager"],
		attr = telephoneNumber present}
		}
	attrs = commonName, surname, telephoneNumber
	common-args = { local-scope };