A few options come to mind:
- The translate filter might work, although tou won't be able to get real-time lookups.
- If you push the data from the relational database into an ES index you can use the elasticsearch filter.
- It should be possible to write a ruby filter that performs the lookups via e.g. HTTP.