title: ColdFusion PDF file search using cfsearch and SOLR extremely slow
body: <p>I have a functional working Adobe ColdFusion application that is indexing roughly 2k PDF files with via Solr search and providing expected results - however each search query to the collection takes generally 25-30 seconds.</p>
  
  <p>This is how I indexed the 2k PDF files to Solr:</p>
  
  <pre><code>&lt;!--- query database files ---&gt;
  &lt;cfset getfiles = application.file.getfiles()&gt;
  
  &lt;!--- create solr query set ---&gt;
  &lt;cfset filesQuery = QueryNew("
      fileUID
      , filepath
      , title
      , description
      , fileext
      , added
  ")&gt;
  
  &lt;!--- create new file query with key path and download url ---&gt;
  &lt;cfoutput query="getfiles"&gt;
  &lt;cfset ext = trim(getfiles.fileext)&gt;
  &lt;cfset path = expandpath('/docs/#fileUID#.#ext#')&gt;
  
  &lt;cfscript&gt;
      newRow = QueryAddRow(filesQuery);
      QuerySetCell(filesQuery, "fileUID","#fileUID#" );
      QuerySetCell(filesQuery, "filepath","#path#" );
      QuerySetCell(filesQuery, "title","#filename#" );
      QuerySetCell(filesQuery, "description","#description#" );
      QuerySetCell(filesQuery, "added","#added#" );
  &lt;/cfscript&gt;
  
  &lt;/cfoutput&gt;
  
  &lt;!--- index the bunch ---&gt;
  &lt;cfindex  
      query = "filesQuery" 
      collection = "resumes" 
      action = "update" 
      type = "file" 
      key = "filepath"     
      title = "title" 
      body = "title, description"
      custom1 = "fileext"
      custom2 = "added"
      category= "file"
      status = "filestatus"&gt; 
  </code></pre>
  
  <p>This is how the files are being searched and where the (25-30 second) Solr search happens:</p>
  
  <pre><code>&lt;!--- imagine form with (form.search) for terms ---&gt;
  
  &lt;cfsearch name = "results" 
      collection = "resumes" 
      criteria = "#form.search#
      contextPassages = "1"
      contextBytes = "300"
      maxrows = "100"
      contextHighlightBegin = "&lt;strong&gt;"
      contextHighlightEnd = " &lt;/strong&gt;"&gt;
  
  &lt;!--- show (results) query ---&gt;
  </code></pre>
  
  <p>Some additional info on the project: all of the files are less than 1 page in length, so there was no character cutoff in creating the index results to Solr.  I have played with the Solr buffer limit within the ColdFusion Administrator with no major discernable change in time (currently at 40).  I am on a development VM with MS Server 2003, 1.86 Xeon - Adobe ColdFusion 9.0.1 and 1GB RAM.  JVM is Sun Microsytems (14.3-b01). Almost nothing else is running server-side, so performance should be unaffected by external factors.</p>
  
  <p>It is providing expected and perfect results, just not in a timely fashion.</p>