How can I get the material index that was physical hits?

I mean, the component hits and trace hits share the same Hit Result output. I thought that if the material index can be obtained by line tracing, it can be obtained by component hit in the same way.
But for some reason it didn’t work…