With postgres, you should be able to use a GIN index anything that's returned by an immutable function.
You may have to write a function that does what you want and Mark it as immutable.
You may have to write a function that does what you want and Mark it as immutable.