I am converting the following simple sql query into tridion content delivery implementation. The query is
select cm.item_id from custom_meta cm where cm.key_name ='AddToItunes' and
cm.key_string_value='Yes' and cm.publication_id=80
The code for content delivery is as below
PublicationCriteria pubCriteria = new PublicationCriteria(publicationId);
CustomMetaKeyCriteria metaKeyCriteria = new CustomMetaKeyCriteria("AddToItunes", Criteria.Equal);
CustomMetaValueCriteria metaValueCriteria = new CustomMetaValueCriteria("Yes", Criteria.Equal);
var finalCriteria = new Criteria[] { pubCriteria, metaKeyCriteria, metaValueCriteria };
Query query= new Query(new AndCriteria(finalCriteria));
var result= query.ExecuteQuery();
The issue is while the result comes same whether executing the raw sql query or using the content delivery api, the order of items is different. Is there any internal mechanism of sorting being used by content delivery as i am not providing any sort parameter.