allowing raw queries
Release 0.5.3
[FIX] Escape single quotes in `to_curl` serialization

When your search query contains a single quote:

    s = Tire.search 'articles' do
      query do
        string "l'amour"
      end
    end

the `to_curl` command produces an invalid JSON payload:

    curl -X GET 'http://localhost:9200/articles/_search?pretty' -d '{
      "query":{
        "query_string":{
          "query":"l'amour"
        }
      }}'

With this patch, the single quote in the query is replaced with a Unicode escape sequence:

curl -X GET 'http://localhost:9200/articles/_search?pretty' -d '{
  "query":{
    "query_string":{
      "query":"l\u0027amour"
    }
  }}'

Closes #561
Added more examples for the `date_histogram` facet in the integration tests
[FIX] Fix broken unit tests for facets

Fixes karmi/tire@5a28781
Added JRuby compatibility

* Added skipping MRI/YARV gems on JRuby in .gemspec
* Added JRuby specific gems into Gemfile
* Added skipping Curb tests on JRuby
* Added `jruby-19mode` into Travis-CI matrix

Closes #555
Minor cleanup of JRuby compatibility

* Formatting, whitespace errors
* Gem dependency configurations
Updated Travis-CI configuration

* Changed starting Elasticsearch to the `services` support
* Added Redis and MongoDB services for integration tests
Added proper `as_json` support for `Results::Collection` and `Results::Item` classes

Previously, the `Collection` and `Item` classes were missing proper `as_json`
serialization support. With this patch, their `as_json` methods are now
ActiveSupport compatible, allowing to eg. expose the results in a Rails controller:

    def search
      @articles = Article.search do ... end
      respond_to do |format|
        format.html { render :action => "index" }
        format.json { render json: @articles.as_json(only: ['id', 'title']) }
      end
    end

Closes #527
Added extracting the `routing` information in the `Index#store` method

    Tire.index('myindex').store( {:id => 1, :title => 'Test'}, {:routing => 'abc'} )

Closes #512
Refactored the `update_index` method for search and persistence integration

Previously, both the ActiveModel search integration and the Persistence support
relied on shared `update_index` implementation.

This has been confusing, and also a source of bugs in Rails
applications using "single table inheritance" or
["single collection"](http://mongomapper.com/documentation/plugins/single-collection-inheritance.html)
in MongoMapper applications, which both rely on the `_type` property.

The `update_index` method has been extracted to the `Tire::Model::Persistence::Storage` module,
and the offending code has been removed from the ActiveModel integration.

Closes #477, fixes #80 and #394.
[#558] Cast collection properties as empty Array by default

Previously, omitting value for casted collection resulted in the property being `nil`.

Now, with a class definition like this:

    class Article
      include Tire::Model::Persistence

      # ...
      property :comments, :class => [Comment]
    end

the `comments` property is by default casted as an empty Array:

    article = Article.new :title => 'Test'
    article.comments
    # => []

Closes #558
[ACTIVEMODEL] Allow passing `:index` option to `MyModel.import`

Allows to index the data into a different index:

    Article.import index: 'new_articles'
[SETUP] Fix deprecation warning for Mocha
[SETUP] Depend on Mocha 0.13, older versions throw exceptions about `mocha/setup`

Please make sure to delete your Gemfile.lock and run `bundle`.

The "shoulda" gem depends on "bourne", which only recently
[upgraded](https://github.com/thoughtbot/bourne/commits/v1.3.0)
to Mocha 0.13.1.
Added the support for the Count API

Added the `Search::Count` API and a DSL support for the Count API.

The semantics is similar to the search DSL and API, the `Tire.count`
method takes the index name(s), query, routing parameters, etc.

    Tire.count 'articles'
    # => 5

    Tire.count('articles') { term :tags, 'ruby' }
    # => 2

    c = Search::Count.new('articles')
    c.value
    # => 5
    c.json['_shards']['total']
    # => 5
    c.response.success?
    # => true

See <http://www.elasticsearch.org/guide/reference/api/count.html> for more information
and the integration tests for documentation.

Closes #521
[#420] Fixed incorrect parsing of `indices` option when the alias contains `routing` values

If a routing value is set, Elasticsearch returns a key called "index_routing",
which can overwrite the "indices" or "index" value if it comes later in the hash iteration,
since that key also matches the regex "/index|indices/".

Closes #420
[#420] Added unit tests for the `Alias` parsing bug fix

Added tests for karmi/tire@8fae686, replacing tests from mriley/tire@835c4cd.
[GEMS] Updated the MultiJson dependency to ~> 1.3

Closes #549
Release 0.5.4