Build an elasticsearch query from a search expression.
Code for
Add this line to your application's Gemfile:
gem 'elastic_parser'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install elastic_parser
ElasticParser.parse("word")
ElasticParser.parse('"search for this exact string"')
ElasticParser.parse("a b c")
or
ElasticParser.parse("a AND b AND c")
ElasticParser.parse("a OR b OR c")
ElasticParser.parse("a -b")
ElasticParser.parse("a (b (c (e d)))")