title: Create a Query language using Python
body: <p>I am working on a search server something like elastic search. Just a small project which I am developing. Have completed most of the parts but am stuck on how the user would interact with the system.</p>
  
  <p>I initially Decided that the user would request by send a JSON query with required fields and its values. But the problem I am facing is, that even though i can evaluate queries using the json way, i wouldn't be able to implement Boolean Queries and Compounf statements.</p>
  
  <p>I was trying something like</p>
  
  <pre><code>index: name
  schema:name
  field1: value
  field 2: value
  </code></pre>
  
  <p>but it could also be something like this if Boolean expression is implemented</p>
  
  <pre><code>index : name
  schema : name
  field 1 : name1 or name 2
  field 2: &lt;9.22 and &gt;=2.32 
  field 3: (&lt;9.22 and &gt;=2.32) or (&lt;100 and &gt;90) // compound statement.
  </code></pre>
  
  <p>Is there a somewhat straightforward way to implement this, without actually creating a Query Language Grammar. If yes, then how might i achieve that, if not then also the same thing.</p>
  
  <p>I was thinking of splitting values based on and/ or of each field but that wouldn't work if there are compound statements.</p>
  
  <p>I was checking out pyparsing as well, but i couldn't figure out a working way to use that.</p>