title: how to create a database schema for storing product search filters
body: <p>I am creating a simple product search webapp where user can filter the shopping products he has bookmarked on the basis of price, free delivery, name, shop etc.</p>
  
  <p>I am looking to implement custom search filters functionality where user can create a search filter, then save it for later use. Search filters are something like this:</p>
  
  <ul>
  <li>price is under $1000</li>
  <li>price is between $1000 to $2000</li>
  <li>free delivery available/not available</li>
  <li>shop is amazon/walmart/...</li>
  <li>name contains "christmas"</li>
  </ul>
  
  <p>Can somebody give me an idea of the database schema for storing such search filters in database. Should I store the mysql clauses in database like "WHERE price &lt; 1000", "WHERE free_delivery=1"... or may be create fields like this..</p>
  
  <ul>
  <li>field (price, name, free_delivery)</li>
  <li>value (1000)</li>
  <li>expr (less than, greater than)</li>
  <li>between (1000)</li>
  <li>and (2000)</li>
  <li>contains</li>
  </ul>