Your query is not a fast query, if you use the following query, it worked for me:
_masterdb.SelectItems("fast:/sitecore/content/Product Catalog/Industrial/Products//*[@@templatename='Industrial Product']");
There are two changes in this query:
- Replace the keyword
query
at the beginning to fast
. This means that it is not a "normal" Sitecore Query, it becomes a Sitecore Fast Query. Please read this guide for more informations about using fast queries.
- Before selecting your items with
*[@@templatename='Industrial Product']
, I've added a double slash //
. This means, that it searched recursive for all items with your template. With your query you only search for direct child items.
Also, I would recommend you to using the keyword @@templateid
instead of @@templatename
, as sitecore climber said it's faster and it's also no problem if you rename the template. So your query could look like this at the end:
fast:/sitecore/content/Product Catalog/Industrial/Products//*[@@templateid='{76036F5E-CBCE-46D1-AF0A-4143F9B557AA}']
Note: This does not only select your children and grand children. This does recursively gives you all items with this template.
ContentSearchManager
and LINQ to Sitecore if you don't want to create your own search indexes – Sirreverence