Make raycast ignore some triggers but hit some others?

I have a script that shoots a ray and if a ray hits a specific trigger it does this or that. The thing is that I want it to hit only some triggers but go through other triggers.
I know you can disable ray hit for triggers globally, but what about per-object basis?

Or can I somehow generate a hit on a trigger but still continue the ray until it hits a collider?


Looks like you could use this:

This will do a raycast through everything, and return all the hits. Then you look for the ones you care about in the results.