title: How to do phrase search using sphinx
body: <p>I need to create phrase search using sphinx. I created my index using this config file</p>
  
  <pre><code>source sphinx_search
  {
      type                                    = mysql
      # some straightforward parameters for SQL source types
      sql_host                                = localhost
      sql_user                                = root
      sql_pass                                = root
      sql_db                                  = mydatabase
      sql_port                                = 3306
  
      sql_query                       = \
          SELECT userId, usertype_id, searchdata from tbl_user;
  
      #sql_attr_uint                       = userId
      sql_attr_uint                       = usertype_id
  
       #document info query, ONLY for CLI search (ie. testing and debugging)
       #optional, default is empty
       #must contain $id macro and must fetch the document by that id
      sql_query_info      = SELECT * FROM tbl_user WHERE userId=$id;
  
  }
  index sphinx_search {
      source                          = sphinx_search
      path                            = /var/lib/sphinx/sphinx_search
      morphology                      = stem_en
      min_stemming_len        = 4
      stopwords                       = /var/data/sphinx/stopwords.txt
      min_word_len            = 3
      min_prefix_len          = 3
      min_infix_len           = 0
      enable_star                     = 1
      phrase_boundary = ., ?, !, U+2026 # horizontal ellipsis
      phrase_boundary_step = 100
      html_strip = 1
  
  } 
  
  indexer {
      mem_limit = 256M    
     #mem_limit       = 128M
      max_xmlpipe2_field = 16M 
  }
  
  
  searchd {   
      compat_sphinxql_magics  = 0     
      listen          = 9312  
      listen          = 9306:mysql41  
      log         = /var/log/sphinx/searchd.log   
      query_log       = /var/log/sphinx/query.log     
      read_timeout        = 5     
      max_children        = 30    
      pid_file        = /var/run/sphinx/searchd.pid   
      max_matches     = 10000     
      seamless_rotate     = 1     
      preopen_indexes     = 1     
      unlink_old      = 1     
      workers     = threads # for RT to work  
      binlog_path     = /var/data/ 
  }
  </code></pre>
  
  <p>If I tried to search for "Water Pollution" word</p>
  
  <p>The search result is showing like this</p>
  
  <pre><code>words:
  1. 'water': 10554 documents, 37143 hits
  2. 'pollut': 1902 documents, 9657 hits
  </code></pre>
  
  <p>First issue is its not taking that "pollution" word completely Instead of that its taking "pollut". </p>
  
  <p>Second problem is its not searching for that complete word. Even if I search </p>
  
  <blockquote>
    <p>"water pollution" 
    like this.</p>
  </blockquote>
  
  <p>third problem I am unable to sort my result with userId. If I tried to add </p>
  
  <blockquote>
    <p>sql_attr_uint                       = userId</p>
  </blockquote>
  
  <p>its not indexing properly.</p>
  
  <p>Any body can help me to fix these issues. Please help me.</p>