Over a year ago I actually started importing the blockchain and doing just that, but it requires the full blockchain imported into MySQL or your preferred database.
Interested in doing this too. Found this to import blockchain into MongoDB:
https://github.com/thelinuxkid/bitcoinquery