search
Searches the database for data within one or more publications.
Parameters
- action
- search
- min
- The index of the first search result to return. Defaults to 0.
- chunk
- The length of the array of search results to return. Defaults to 10.
- max
- The maximum number of search results to return. Defaults to 0, which indicates no maximum is set.
- sort
-
The sort type to use against this search. The base skin supports
alpha(alphabetical),date(most recent objects first) and defaults to relevancy, per the Lucene relevancy algorithm. Other sort values could be used to execute a custom sort routine defined in your customized skin. - scope
-
The scope of the search. If left blank, this defaults to
full, which executes a full text search against the database. If a scope parameter is provided, this will either trigger a search category, or a custom search query defined in your customized skin. - query
-
The search query itself. This can include special search characters such as
*, +, - - searchId
- A unique ID for the search. This ID should be provided to the API call in the case of making a second API call to page through the results of a search. Can be used for example to link together disparate search and document loading events.
- format
-
The output format for the results. Either
htmlorxml. Defaults tohtml. - lang
-
The language of the source content to search. The search routine will not search content outside of this language group. You can provide a specific (
en-GB) or shortened (en) language identifier. When using a shortened language identifier, the search will locate content in a more specific, but matching language. For example, if you execute a search infr, content stored asenwill not be found. However, if you searched for content withinen, content withinen-GBwould be found. - pub
- Optional publication name. If provided, only content within this publication will be returned. If not provided, all publications will be searched.
- filter
- Allows a search to enable or disable filtered searches. Enabling filtered searches has a negative performance impact.
Example URL
http://<host>:<port>/<context>/web/search.xql?action=search&min=<value>&chunk=<value>&max=<value>&sort=<value>&scope=<value>&query=<value>&searchId=<value>&format=<value>&lang=<value>&pub=<value>&filter=<value>
Successful Result
If format is set to html the search function returns an HTML list of the search results, including highlighted terms, clickable links to open the results, and a pager to move through the results if applicable. If the format is set to xml the search function returns the XML representation of the search results.
Failed Result
The search function may return an empty search result if it finds nothing that matches the query.