Skip to content

Build an elasticsearch query from a search expression.

License

Notifications You must be signed in to change notification settings

glenbray/elastic_parser

Repository files navigation

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)))")

About

Build an elasticsearch query from a search expression.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published