I’ve been working with Sitecore Fast Query and Sitecore Query for a long time. Sitecore Fast Query is translated to SQL queries that be executed by the database engine. Fast Query is more efficient in terms of execution time and performance as compared to Sitecore Query. Few days ago I’ve noticed that Sitecore fast query doesn’t return hierarchical result set as compared to Sitecore content tree structure. In other words, Sitecore Fast Query retrieves a plain list of the Sitecore items regardless of the content tree hierarchy.
Comments and suggestions are most welcome. Happy coding!
- Sitecore Content Tree Structure: Below image is part of Sitecore content tree. I’ve to find out all descendants of AccordionBottom item (item id = {2FCB17C4-8EB2-427E-97FE-12A0BECE4044}) that are based on the template with the specified Id.
- Fast Query: Below Fast Query returns result set in jumbled order.
fast://*[@@id = '{2FCB17C4-8EB2-427E-97FE-12A0BECE4044}']//*[@@TemplateId = '{39ACE8CB-4EE3-4989-9B73-5CAFEC21B70C}']
- Sitecore Query: Below Sitecore Query returns result set in hierarchical order as per content tree structure.
//*[@@id = '{2FCB17C4-8EB2-427E-97FE-12A0BECE4044}']//*[@@TemplateId = '{39ACE8CB-4EE3-4989-9B73-5CAFEC21B70C}']
Comments and suggestions are most welcome. Happy coding!
0 comments :
Post a Comment