[#352] Added, that accessing Tire::Search#json forces perform

Conflicts:

	lib/tire/search.rb
[#352] Whitespace cleanup in Tire::Results::Collection
[#352] Added MyModel#new_record? for Tire::Persistence

Commit <https://github.com/erickt/tire/commit/40cb9753b25cd943e35ddf5ce52c0384ae98482e> rewritten and cleaned up by @karmi
[#366] Added support for the Update API in Tire::Index

Usage:

    tags = ['a', 'b', 'c']

    Tire.index 'my_index' do
      update 'document_type', 'document_id', {
        :script => "_ctx._source.tags = tags;',
        :params => {:tags => tags}
      }
    end
[#366] Cleaned up the Update API support and added an integration test suite

This patch expands karmi/tire@f620b36.

* Polished the `curl` output from the API call
* Added the ability to pass URL parameters (timeout, refresh, etc)
* Cleaned up the unit tests
* Added a separate integration test for resilience and documentation

Example usage
-------------

Update a counter:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ruby
  Tire.index('articles-with-tags') { update( 'article', '1', :script => "ctx._source.views += 1" ) and refresh }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add a tag to the document:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ruby
    Tire.index('articles-with-tags') do
      update 'article', '1', :script => "ctx._source.tags += tag",
                             :params => { :tag => 'new-tag' }
      refresh
    end
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Set a title of the document:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ruby
  @title = 'Foo Is Now Bar!'

  Tire.index('articles-with-tags') do |index|

    index.update 'article', '1', :script => "ctx._source.title = title",
                                 :params => { :title => @title }
    index.refresh
  end
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

See <http://www.elasticsearch.org/guide/reference/api/update.html> for more documentation.

---

Closes #366.
Patch Test::Unit::Assertion#assert on Ruby 1.8 to return true on success

Our Mocha `with do ... end` blocks fail otherwise.
[TESTS] Fixed errors on Ruby 1.8

* Changed Ruby 1.9 hashes to hashrocket syntax
* Changed regex to allow different URL parts order
[FIX] Fixed incorrect `Results::Item#to_hash` serialization

Without this fix, `Item#to_hash` returned `Item` instances for nested Hashes.

This commit calls `to_hash` recursively in `Item#to_hash`
Fixed incorrect `to_curl` output in Tire::Index#register_percolator_query
[#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.