This one may be a bug, or it may be me failing to understand something.
Assuming there are some named 'Profile' items inside /sitecore/system/marketing center/profiles, this query returns all of them (tested in XPath Builder):
fast:/sitecore/system/marketing center/profiles/*[@Name='%' and @@templatename='Profile']
But if I reverse the two predicates, I get no results. That's this query:
fast:/sitecore/system/marketing center/profiles/*[@@templatename='Profile' and @Name='%']
Each of the predicates works separately, giving correct results to my eyes.
I wasted several hours on this today hunting this bug down in a Lucene indexer (Man, I hate it when I'm right).
Any clues on why this only works one way around and how to avoid stumbling on it in the future?