How Elasticsearch works with respect to Memory and storage?

Hi Friends,

I have been reading the documents, but not clear on its working. I would like to know about a scenario where I have 100 GB to 300 GB data in the RDBMS database. I need to perform search and analytics on that data. Hence, I will use Logstash to ingest all that data into elasticsearch. I am thinking that all that data will be stored in the server where Elasticsearch is installed. Correct me if I am wrong. I have an opinion that when a search takes place in elasticsearch, it will use RAM memory, so 300GB data is huge for the RAM memory to support. So, how it works. Can anyone of you please explain the working of Elasticsearch in terms of memory and also w.r.t important features.

Thanks in advance