Search

Description

Searches for nodes.

Input

<Search>
<userLogonReference>userid</userLogonReference>
<password>password</password> <query/> <searchField/> <package/> <page/> <pageSize/> <searchInfo/>
</Search>

User credentials are optional, but if passed must be correct.

Query is the string to search for.

searchField is where to search for it:

  • name – Search only on node names
  • all – Search on all node data.

package – the package to search. Omitted = all packages.

page – page of results to return. Defaults to 1.

pageSize – size of page to return. May be defaulted or overriden by the service.

searchInfo – a string passed back from search that should be passed in when retrieving subsequent pages.

To retrieve subsequent pages you should pass searchInfo and page.

Output

<Search>
<errorNumber>0</errorNumber> <page/> <numberOfResults/> <numberOfPages/> <searchInfo/> <NodeList> <Node> <nodeVersionReference/> <nodeName/> <nodeSummary/> </Node> </NodeList>
</Search>

numberOfResults is an approximate count of results. numberOfPages is an approximate count of pages.

page may be different from that requested. For example, if there are 5 pages of results and you request page 6, you may be returned to page 5.

searchInfo should be passed back to retrieve subsequent pages for the same query.

nodeSummary is a summary of the node that should be shown to the user. It is typically built from the node description. It may contain invalid markup, and should be filtered before being displayed.

The node list only lists nodes that the user is authorised to read.

Errors

101 – Invalid user.

103 – Invalid parameter.

Notes

There are different implementations of this service. There is a simple search service which performs a case-insensitive exact match with the search term, and a more sophisticated search service that uses an external search engine. The current Metrici instance uses the more sophisticated search service.