title: How to create a search language?
body: <p>I would like to create a simple filtering language in Javascript.</p>
  
  <p>I want to search inside a collection of products, say:</p>
  
  <pre><code>product=[
     {price:10,name:"T-Shirt",category:"Clothing",published_at:"07-08-2014",size:"10x30",color:"#0000FF"},
     {price:20,name:"Chair",category:"Furniture",published_at:"09-03-2013",size:"30x30",color:"#00FF00"},
     {price:30,name:"iPhone",category:"Phones",published_at:"17-03-2014",size:"40x30",color:"#FF00FF"},
     {price:40,name:"Samsung Galaxy",category:"Phones",published_at:"12-01-2012",size:"10x60",color:"#00BBBB"},
  ];
  </code></pre>
  
  <p>With only one input of text, I would like to be able to query inside this array, for example:</p>
  
  <ul>
  <li><code>cat:Clothing</code> =>  gives back the tshirt</li>
  <li><code>price:&gt;15</code> => gives back Chair, iPhone, and Samsung Galaxy</li>
  <li><code>name:iP</code> => Filters trough the names and gives back iPhone</li>
  <li><code>price:&gt;15&amp;&amp;size:&gt;35x25</code> => Filters trough the names and gives back iPhone</li>
  </ul>
  
  <p>I know they are some language parsers like</p>
  
  <ul>
  <li><a href="https://github.com/tolmasky/language" rel="nofollow">https://github.com/tolmasky/language</a></li>
  <li><a href="https://github.com/zaach/jison" rel="nofollow">https://github.com/zaach/jison</a> (used by coffeescript)</li>
  </ul>
  
  <p>but I don't know which one to choose (and why) and if it is a good idea to use one ? Any ideas ?</p>