Skip to main content
Tweeted twitter.com/#!/StackTridion/status/323537994218868738
Formatting, grammar
Source Link

what What is the default sort order of a query in tridion content deliveryTridion Content Delivery?

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

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.

Thanks, Rajendra

what is the default sort order of a query in tridion content delivery

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.

Thanks, Rajendra

What is the default sort order of a query in Tridion Content Delivery?

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.

Source Link
rdhaundiyal
  • 1.9k
  • 12
  • 20

what is the default sort order of a query in tridion content delivery

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.

Thanks, Rajendra