title: Apache Solr - Unknown Sort Order
body: <p>In my watchdog logs, I am getting the following error:
  Unknown sort order: <strong>The request sent by the client was syntactically incorrect (Unknown sort order: for weddings).</strong></p>
  
  <p>This is the var_dump of <code>$qry</code> (<code>$qry = new Solr_Query(</code>))</p>
  
  <pre><code>object(Solr_Query)#28 (7) { 
      ["terms"]=&gt; NULL 
      ["keys"]=&gt; string(31) " arts &amp; crafts for weddings" 
      ["filters"]=&gt; string(11) " type:frame" 
      ["sort"]=&gt; string(14) "timestamp desc" 
      ["perpage"]=&gt; int(24) 
      ["page"]=&gt; int(0) 
      ["params"]=&gt; array(0) { } 
  } 
  </code></pre>
  
  <p>Using Apache Tomcat/6.0.18, Drupal 6</p>
  
  <p>EDIT: It seems the ampersand is causing the issue. When I remove that, there is no error. Also having quotes in the search term results in an error.</p>