When the Sterling Search Index is configured to identify colonies in a sharded database environment, APIs such as getOrderLineList and getOrderInvoiceList do not always return records as expected.
In most cases, the indexable attributes are not passed at the correct place. Refer to the Extending APIs to Search Against the Index topic, and identify the XML elements used for searching against the index for the API. For example, the indexable attributes passed under the Order element are used for searching against the index in the case of the getOrderLineList API. If an empty Order element (<Order/>) is passed, the API will be called on all colonies. However, if the <Order> element is not present in the input, shards will be derived using the normal API Facts, which may return either one colony or fall back to the default colony, resulting in incomplete results or no result. To solve this, either pass the input correctly, or extend the apiIndexLookup file to add an XML element that also contains indexable attributes. For example, in the case of the getOrderLineList API, the OrderLine element contains some of the indexable attributes and, hence, it can be included in the path in the apiIndexLookup.xml file, as follows:
<getOrderLineList>
<Index Name="Order" Path="OrderLine"/>
</getOrderLineList>