Skip to content

Latest commit

 

History

History
76 lines (44 loc) · 1.01 KB

README.md

File metadata and controls

76 lines (44 loc) · 1.01 KB

Build Status

ElasticParser

Build an elasticsearch query from a search expression.

Code for

Installation

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

Usage

Simple term search

ElasticParser.parse("word")

Phrase search

ElasticParser.parse('"search for this exact string"')

Perform AND operations

ElasticParser.parse("a b c")

or

ElasticParser.parse("a AND b AND c")

Perform OR operations

ElasticParser.parse("a OR b OR c")

Perform NOT operations

ElasticParser.parse("a -b")

Grouping

ElasticParser.parse("a (b (c (e d)))")