title: How do upload text document and is it possible to enable full text search on it?
body: <p>I am using the following technologies:</p>
  
  <ol>
  <li>JRuby 1.7.4</li>
  <li>Rails 3.2.13</li>
  <li>Ubuntu 13.04</li>
  <li>DB2 C-Express</li>
  <li>Torquebox server 2.3.0</li>
  </ol>
  
  <p>My goal is to make a simple controller which implements the following functions:</p>
  
  <ol>
  <li>Upload text files (MS Word format, Open Office or Libre Office formats)</li>
  <li>Perform a full text search on the uploaded files</li>
  <li>Display the text files in the browsers as PDFs</li>
  </ol>
  
  <p>I have searched for gems that can help me to achieve that and have the following questions:</p>
  
  <ol>
  <li>What should be the column type of the field that is storing the text file. Generally, I supposed it should be binary type.</li>
  <li>Is it possible to perform full text search using <a href="http://sunspot.github.io/" rel="nofollow">Sunspot</a>? As I have read, it seems to work with fields of type text, not binary.</li>
  <li>I read about two gems that allow me to generated PDFs. The <a href="http://prawn.majesticseacreature.com/" rel="nofollow">Prawn</a> gem, which adds more flexibility and the <a href="https://github.com/pdfkit/PDFKit" rel="nofollow">PDFkit</a> which can generates PDFs from HTML pages. Can any of this be used to display the text file? I am supposing that I should first display somehow in HTML, and then  use the PDF gem.</li>
  </ol>
  
  <p>Has anyone done something like this and could you point me in the right direction?</p>