The first answer is beautiful, but it leaves out some critical details about modern versions of Emacs. I am knew to Emacs myself, so other newcomers might not be aware of this. Given your goal is to search for text WITHIN a file in a PROJECT, then you would first install Projectile using the MELPA repository.
This installs the package in .emacs.d and adds some basic configuration to .emacs in your $USER directory (assuming you had created the .emacs file), such as requiring Projectile in your Emacs install.
However, you still need to enable it and associate keymap prefixes, so you can invoke it in the mini buffer.
The accepted answer mentions the following command:
C-c p s g
This will not work, unless you configure Projectile with this keymap prefix. But I configured it to use C-c C-p as the command for Project in .emacs:
(define-key projectile-mode-map (kbd "C-c C-p") 'projectile-command-map)
Now given this, I am able to perform text searches in files in a project using grep:
C-c C-p f # switch to a project first
C-c C-p s g # perform grep search in project
To break it down,
C-c C-p will invoke Projectile, and
s g will perform the grep search. You will get a beautiful output like this, assuming your search is
visit_contact and you are searching Ruby's rspec in a project:
./spec/support/capybara_classification_code_helper.rb:21: def visit_contact