How to create memory based index

I am using Elastic Search with 10 shards with 1 replication and local storage. How can I tweak my settings so that index is stored in memory. I need index in memory for performance reasons.

Also is there a way to configure gateway such that it only stores meta data on shared nfs and not the indices also ?