elasticsearch by example
elasticsearch by example is a simple framework to learn and play with elasticsearch.
It will help you get started in elasticsearch and provide a sandbox for experimentation and comparison of features.
Each example contains a info file with the key information on the feature, sample data, a mapping file and a search query. You can see the output directly into the console.
It is important that the program is kept as simple as possible. A elasticsearch beginner should easily understand each step.
Clone the project repository from GitHub:
git clone git://github.com/rmoszczynski/elasticsearch-by-example.git cd elasticsearch-by-example bundle install
If you have already installed elasticsearch local or on a remote machine you're done.
elasticsearch by example uses its own elasticsearch configuration file stored in
To use a remote elasticsearch installation
please customize the
port values in the
If you have not yet run a elasticsearch instance, you can start one:
bundle exec foreman start
To run an example:
As you can see the
run task takes one parameter, a path to a selected
example directory relative to the
examples directory in the root of this project.
You can list all examples by using the
To run only the query without create a new index, apply mapping and index documents use the
To see all Rake tasks:
You can send feedback via GitHub Issues.
elasticsearch by example. All files in this project are licensed under the following license: Copyright (c) 2012, Robert Moszczynski. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Robert Moszczynski GitHub