After a few hours of figuring out Lucene, I gave up. Hope you can help.
Setting
In our current Sitecore tree, we have template 2 template inheritance levels. (Let's say Vehicle -> Car -> Formula One / Vehicle -> Boat).
What I would need to fetch through Lucene now, is every ContentItem inheritting either directly, or indirectly, from a certain Template.
For instance:
- Get vehicles -> returns: "Generic" Vehicles, Cars, F1 Cars and boats
- Get cars -> returns: Cars, F1 Cars
What I thought was using the _templates-field in Lucene, ie:
Get Vehicles -> _templates contains Vehicle-template-guid.
Get Cars -> _templates contains Car-template-guid.
The problem
The main problem I experience is that Content Items of the F1 Car-template contain only the Cars and F1 Car in the _templates-field, and not the generic "Vehicle".
I probably misinterpret the _templates-field, but am wondering if there's any other options.
Sitecore configuration:
Content items:
- sitecore
- content
- Home
- ACategory
- A Child 1
- A Child 1.1
- A Child 2
- ACategory
- Home
- content
Templates (levels = inheritance):
- Main entity
- Child entity 1
- Child entity 1.1
- Child entity 2
- Child entity 1
- Category