Searching an order

All order documents that are saved and indexed in the Order Search repository can be searched by the searchable attributes by using the SearchOrder API.

The SearchOrder API supports pagination and sorting. You can sort the result set by one or more fields, and returned in pages of the specified sizes. A particular page in the result set can be easily retrieved by specifying the page number. Each response consists of page information as well.

The SearchOrder API supports the following querying options:

  • QueryPattern - A set of query and additional specifications in a standard format pattern to search various searchable fields in index.
  • DocumentQuery - JSON equivalent of a typical Sterling Order Management System Software getEntityList API input XML that consists of searchable fields.
  • RawQuery - An Elasticsearch query to directly search the searchable fields.

To search by specific field, use the fully qualified field name as a search criteria. For example, consider the PersonInfoBillTo field of object type consists of FirstName property that is defined in the schema. To search by the first name, use the fully qualified PersonInfoBillTo.FirstName field name. You can use only the leaf level fields as a search criteria.

In addition to the custom searchable fields you can also use these default fields such as a search criteria. The default fields such as orderId, status are stored in the index as _orderId and _status respectively. In order to use the default fields as your search criteria, use the fully qualified name such as, _orderId.orderNo, _orderId.documentType, _orderId.enterpriseCode, _orderId.id, _status, and isHistory.

The response returned is template controlled. You can specify the orderId, status, and summary fields to be returned as part of the response. You can specify the summary field in the response template to be returned as part of the response, which can be used by UIs that do not need a detailed information.

In addition to the response template control, you can also request specific fields that are configured as returnable fields as part of the response.