OK, I know the question is kinda usual. My problem is I want some objects in a scene completely transparent/invisible (in most of the render passes) while I still can show it in either material or object index pass. I would avoid duplicate the scene because it's quite large and complicated and the less labor, the merrier.
In Cycles you can adjust the Alpha Threshold for the Render Layer to adjust how layers are affected by transparency. Setting the Alpha Threshold to 0.000 will result in all objects - even those that are completely transparent - affecting the Index passes (as well as the Z, Normal, UV, and Vector passes).