[#190] [FIX] Tire::Search::Search#version should return `self` to allow chaining

Fixes karmi/tire@2bf558508e0cf8457c826e7251e80a501ed0340e by @gedwards
[ACTIVEMODEL] Allow to pass :version option in Tire::Model::Search::ClassMethods#search
[#352] [FIX] Fixes MyModel#persisted? for Tire::Model::Persistence integration

Fixes karmi/tire@cef81338e225150dea0181773760647f05cf83e0 by @erickt
[FIX] Fixes Ruby 1.8.7 incompatibility

* Fixes karmi/tire@6c3b852 by @karmi (incorrect trailing dot)
* Fixes karmi/tire@ce47d00 by @karmi (Hash order)
[CI] Added running functional tests against live elasticsearch at Travis CI [http://travis-ci.org/#!/karmi/tire]

Squashed from the `karmi/tire@travis` branch:

c2d7f0d ‣ Restructuring the Travis configuration
79f454d ‣ Added running integration tests against live elasticsearch on Travis
d1c4374 ‣ Allow build failures on 1.8.7 and REE
b4fa8a0 ‣ Changed, that integration tests are run only on Ruby 1.9, unit tests on all Rubies
[CI] Use "turn" when running under CI
Fix typo (s/operation/operating/) system

Closes #412
Added support for aggregating over multiple fields in the "terms" facet

See “Multi Fields”, <http://www.elasticsearch.org/guide/reference/api/search/facets/terms-facet.html>
[#300] Added the "Dis Max Query"

Usage:

Tire.search 'index' do
  query do
    dis_max do
      query { string 'foo' }
      query { terms :tags, ['baz'] }
    end
  end
end

See http://www.elasticsearch.org/guide/reference/query-dsl/dis-max-query.html

Closes #300.
[#300] Added an example for "Dis Max Query" based on elasticsearch documentation

NOTE: The dis_max query gives exactly the same result as a boolean query:

    boolean = Tire.search 'dis_max_test' do
      query do
        boolean do
          should { string "albino",   fields: ['title', 'text'] }
          should { string "elephant", fields: ['title', 'text'] }
        end
      end
    end

This seems to contradict <http://www.elasticsearch.org/guide/reference/query-dsl/dis-max-query.html>?

> We want the primary score to be the one associated with the highest boost,
> not the sum of the field scores (as Boolean Query would give).
> If the query is “albino elephant” this ensures that “albino” matching one field
> and “elephant” matching another gets a higher score than “albino” matching both fields.
[#300] Added DisMaxQuery#to_json

Closes #415.
[FIX] Fixed errors in the "terms" facet on Ruby 1.8

In Ruby 1.8.x:

    "hello".is_a?(Enumerable)
    # => true

    "hello".respond_to?(:each)
    # => true

Can be confusing, yeah. You should upgrade to 1.9 :)
Added the ability to transform documents when reindexing
[TEST] Added an integration test for verifying document is store as proper type
[#461] Fixed the incorrect instructions for Mongo integration

Fixes #438, closes #461
Release 0.4.3
Added the `Tire::Configuration.pretty` option for JSON output

* The option is set to `true` by default
* Pass a truthy value to set the option to "true" or false/nil or false/nil to set the option to "false"
Added prettified JSON output for logging requests and responses at the `debug` level

Instead of displaying the request payloads and elasticsearch response as one lump,
use the `pretty` option in the JSON decoder/encoder by default:

    # 2012-09-21 17:29:47:506 [DELETE] ("articles")
    #
    curl -X DELETE http://localhost:9200/articles

    # 2012-09-21 17:29:47:508 [200]
    #
    # {
    #   "ok": true,
    #   "acknowledged": true
    # }

    # 2012-09-21 17:29:47:555 [CREATE] ("articles")
    #
    curl -X POST http://localhost:9200/articles -d '{
      "mapping": {
        "title": {
          "type": "string",
          "analyzer": "snowball"
        }
      }
    }'

    # 2012-09-22 10:43:58:851 [_search] (["logger-articles"])
    #
    curl -X GET "http://localhost:9200/logger-articles/_search?pretty=true" -d '{
      "query": {
        "query_string": {
          "query": "One"
        }
      }
    }'

To disable the default, set `Tire::Configure.pretty(false)`.
[TEST] Fixed bogus test failures on Ruby 1.8 due to Hash key ordering issues
[#334] Use `options.delete(:sort)` in model search to halt bubbling of `sort` into URL parameters

When the query is provided as hash, the params get concatenated, producing a query like this:

    curl -X GET "http://localhost:9200/graylog2/message/_search?from=0&page=1&per_page=100&size=100&sort=created_at+desc&pretty=true" -d '{"query":{"query_string":{"query":"*"}},"sort":[{"created_at":"desc"}],"size":100,"from":0}'

It produces an error:

    Parse Failure [No mapping found for [created_at desc] in order to sort on]

I don't know whether the other parameters should be there, as they're duplicated in the query, but at least they don't make the request invalid.