title: Can some help me in implementing Faceted search in PHP
body: <p>I am trying to build a faceted search for a PHP based e-commerce website. Building filters using <code>GET</code> methods is making code very complicated as the website has many filters. Can someone give some tutorial or some better way for building a faceted search?</p>
  
  <p>I thought of implementing faceted search using Sphinx, but I am new to Sphinx. The client has rejected Sphinx (I don't know why). I am able to build basic search using Sphinx, but don't know how to go ahead with faceted search. If someone can provide some tutorials on Sphinx that will be great as I may try to convince the client after implementing using it. Time is a major factor here as I have to implement faceted search in a day.</p>
  
  <pre><code>$urlstring = '';
  $urlstring = rmParamQS('category');
  $urlstring = rmParamQS('brand', $urlstring);
  </code></pre>
  
  <p>code that will add the new query string like category or brand and will remove existing query strings from above functions</p>
  
  <pre><code>$url = 'http://' . $_SERVER['SERVER_NAME'].'?page='.$page.$urlstring;
  
  $categoryGet = (isset($_GET['category']))?$_GET['category']:NULL;
  $categoryQS = '&amp;category='.$categoryGet;
  
  $brandGet = (isset($_GET['brand']))?$_GET['brand']:NULL;
  $brandQS = '&amp;brand='.$brandGet;
  
  $categories = categories_list($brandGet);
  
  echo '&lt;ul id="categories"&gt;';
  list all categories using foreach with link in following format
  echo '&lt;a href="'.$url.'&amp;category='.$category["category_id"].'"&gt;'
  echo '&lt;/ul&gt;';
  
  $brands = brands_list($categoryGet);
  echo '&lt;ul id="brands"&gt;';
  list all brands using foreach with link in following format
  echo '&lt;a href="'.$url.'&amp;brand='.$brand["brand_id"].'"&gt;'
  echo '&lt;/ul&gt;';
  </code></pre>
  
  <p>Like categories and brands I have five more filters. The rmParamQS function will remove the respective query string from $url. the categories_list and brands_list functions will filter data based on ids in Query Strings in url of other filters</p>