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.
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.
I was trying something like
index: name
schema:name
field1: value
field 2: value
but it could also be something like this if Boolean expression is implemented
index : name
schema : name
field 1 : name1 or name 2
field 2: <9.22 and >=2.32
field 3: (<9.22 and >=2.32) or (<100 and >90) // compound statement.
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.
I was thinking of splitting values based on and/ or of each field but that wouldn't work if there are compound statements.
I was checking out pyparsing as well, but i couldn't figure out a working way to use that.