Search encrypted data

I encrypt a few fields in a table. How can I search for data in rails and these fields? Can I make a temporary table that is decrypted with original text on the fly, which is destroyed after a search?

I encrypt and decrypt in the model, when leaving and fetching data.