title: How to query Sphinx for an exact matching phrase?
body: <p>It seems that Sphinx is searching the documents word by word. I don't know how to search the documents for an exact phrase. I tried <code>SPH_MATCH_ALL</code>, <code>SPH_MATCH_PHRASE</code> but all search the documents word by word. I'm using it in my PHP application.</p>
  
  <p>How do I query Sphinx to match an exact string?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>$sphinx = new SphinxClient();
  $mode = SPH_MATCH_PHRASE;
  $sphinx-&gt;setServer('127.0.0.1', 9312);
  $sphinx-&gt;setLimits(0,1);
  $sphinx-&gt;setMaxQueryTime(5000);
  $sphinx-&gt;setMatchMode($mode);
  $sphinx-&gt;setFieldWeights(array('name' =&gt; 100));
  $sphinx-&gt;setArrayResult(true);
  
  $result = $sphinx-&gt;query('Lorem ipsum dolor sit amet, consectetur adipiscing elit.');
  print_r($result);
  </code></pre>
  
  <p>The return result is this:</p>
  
  <pre><code>Array (
      [error] =&gt;
      [warning] =&gt;
      [status] =&gt; 0
      [fields] =&gt; Array (
          [0] =&gt; name
          [1] =&gt; company
          [2] =&gt; image
          [3] =&gt; price
      )
      [attrs] =&gt; Array ()
      [total] =&gt; 0
      [total_found] =&gt; 0
      [time] =&gt; 0.000
      [words] =&gt; Array (
          [lorem] =&gt; Array (
              [docs] =&gt; 0
              [hits] =&gt; 0
          )
          [ipsum] =&gt; Array (
              [docs] =&gt; 0
              [hits] =&gt; 0
          )
          [dolor] =&gt; Array (
              [docs] =&gt; 0
              [hits] =&gt; 0
          )
          [sit] =&gt; Array (
              [docs] =&gt; 0
              [hits] =&gt; 0
          )
          [amet] =&gt; Array (
              [docs] =&gt; 0
              [hits] =&gt; 0
          )
          [consectetur] =&gt; Array (
              [docs] =&gt; 0
              [hits] =&gt; 0
          )
          [adipiscing] =&gt; Array (
              [docs] =&gt; 0
              [hits] =&gt; 0
          )
          [elit] =&gt; Array (
              [docs] =&gt; 0
              [hits] =&gt; 0
          )
      )
  )
  </code></pre>
  
  <p>As you can see, Sphinx is searching the documents word by word...</p>