During installation of Exchange 2010, it asks for the Microsoft Filter Pack 2 to be installed. However, you still cannot search the attachment in Outlook Web App. You must configure it first. Refer Register Microsoft Filter Pack
Or download the zip file and extract it.
Run RegisterMicrosoftFilterPack.ps1 in Microsoft Management Shell.
Stop-Service msftesql-Exchange -Force; Start-Service MSExchangeSearch
From Outlook Web App, e.g. https://ex1/owa and login as administrator, you could search for words included in attachments (MS word, excel, ppt, txt, etc) but not pdf format.
Configuring the PDF filter for Exchange 2010
download PDF iFilter 9 for 64bit platform
extract and install it.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\V14\MSSearch\CLSID\
Create a Key:{E8978DA6-047F-4E3D-9C78-CDBE46041603} and set its Default to PDFFilter.dll
Create a string type: ThreadingModel and set it to Both
Create a DWORD type: Flags and set it to 00000001
As shown below:

Create a string type: .pdf and set it to {E8978DA6-047F-4E3D-9C78-CDBE46041603}
as shown below:

Start Microsoft Exchange Management Shell
net stop msftesql-exchange;net start msexchangesearch
Restart-service MSExchangeIS
cd $Exscripts
./resetSearchIndex.ps1 -force -all
Wait for the indexing to finish before initiating search.
From https://ex1/owa, you could search the content included in the pdf attachments.
However, you still cannot search the content included in the pdf attachments from Outlook, even though you enable the instant search and you can search the content included in the word attachments. Outlook instant search uses the client side Windows Search service.
Windows Search support PDF indexing when a PDF IFilter, such as the Adobe Acrobat Reader or Foxit PDF IFilter, is installed.
To configure Outlook client to search for PDF attachment, go to control panel and find Indexing Option
Click "Advanced" button and click "Rebuild"