load_balanced_tire 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +14 -0
- data/.travis.yml +29 -0
- data/Gemfile +4 -0
- data/MIT-LICENSE +20 -0
- data/README.markdown +760 -0
- data/Rakefile +78 -0
- data/examples/rails-application-template.rb +249 -0
- data/examples/tire-dsl.rb +876 -0
- data/lib/tire.rb +55 -0
- data/lib/tire/alias.rb +296 -0
- data/lib/tire/configuration.rb +30 -0
- data/lib/tire/dsl.rb +43 -0
- data/lib/tire/http/client.rb +62 -0
- data/lib/tire/http/clients/curb.rb +61 -0
- data/lib/tire/http/clients/faraday.rb +71 -0
- data/lib/tire/http/response.rb +27 -0
- data/lib/tire/index.rb +361 -0
- data/lib/tire/logger.rb +60 -0
- data/lib/tire/model/callbacks.rb +40 -0
- data/lib/tire/model/import.rb +26 -0
- data/lib/tire/model/indexing.rb +128 -0
- data/lib/tire/model/naming.rb +100 -0
- data/lib/tire/model/percolate.rb +99 -0
- data/lib/tire/model/persistence.rb +71 -0
- data/lib/tire/model/persistence/attributes.rb +143 -0
- data/lib/tire/model/persistence/finders.rb +66 -0
- data/lib/tire/model/persistence/storage.rb +69 -0
- data/lib/tire/model/search.rb +307 -0
- data/lib/tire/results/collection.rb +114 -0
- data/lib/tire/results/item.rb +86 -0
- data/lib/tire/results/pagination.rb +54 -0
- data/lib/tire/rubyext/hash.rb +8 -0
- data/lib/tire/rubyext/ruby_1_8.rb +7 -0
- data/lib/tire/rubyext/symbol.rb +11 -0
- data/lib/tire/search.rb +188 -0
- data/lib/tire/search/facet.rb +74 -0
- data/lib/tire/search/filter.rb +28 -0
- data/lib/tire/search/highlight.rb +37 -0
- data/lib/tire/search/query.rb +186 -0
- data/lib/tire/search/scan.rb +114 -0
- data/lib/tire/search/script_field.rb +23 -0
- data/lib/tire/search/sort.rb +25 -0
- data/lib/tire/tasks.rb +135 -0
- data/lib/tire/utils.rb +17 -0
- data/lib/tire/version.rb +22 -0
- data/test/fixtures/articles/1.json +1 -0
- data/test/fixtures/articles/2.json +1 -0
- data/test/fixtures/articles/3.json +1 -0
- data/test/fixtures/articles/4.json +1 -0
- data/test/fixtures/articles/5.json +1 -0
- data/test/integration/active_model_indexing_test.rb +51 -0
- data/test/integration/active_model_searchable_test.rb +114 -0
- data/test/integration/active_record_searchable_test.rb +446 -0
- data/test/integration/boolean_queries_test.rb +43 -0
- data/test/integration/count_test.rb +34 -0
- data/test/integration/custom_score_queries_test.rb +88 -0
- data/test/integration/dis_max_queries_test.rb +68 -0
- data/test/integration/dsl_search_test.rb +22 -0
- data/test/integration/explanation_test.rb +44 -0
- data/test/integration/facets_test.rb +259 -0
- data/test/integration/filtered_queries_test.rb +66 -0
- data/test/integration/filters_test.rb +63 -0
- data/test/integration/fuzzy_queries_test.rb +20 -0
- data/test/integration/highlight_test.rb +64 -0
- data/test/integration/index_aliases_test.rb +122 -0
- data/test/integration/index_mapping_test.rb +43 -0
- data/test/integration/index_store_test.rb +96 -0
- data/test/integration/index_update_document_test.rb +111 -0
- data/test/integration/mongoid_searchable_test.rb +309 -0
- data/test/integration/percolator_test.rb +111 -0
- data/test/integration/persistent_model_test.rb +130 -0
- data/test/integration/prefix_query_test.rb +43 -0
- data/test/integration/query_return_version_test.rb +70 -0
- data/test/integration/query_string_test.rb +52 -0
- data/test/integration/range_queries_test.rb +36 -0
- data/test/integration/reindex_test.rb +46 -0
- data/test/integration/results_test.rb +39 -0
- data/test/integration/scan_test.rb +56 -0
- data/test/integration/script_fields_test.rb +38 -0
- data/test/integration/sort_test.rb +36 -0
- data/test/integration/text_query_test.rb +39 -0
- data/test/models/active_model_article.rb +31 -0
- data/test/models/active_model_article_with_callbacks.rb +49 -0
- data/test/models/active_model_article_with_custom_document_type.rb +7 -0
- data/test/models/active_model_article_with_custom_index_name.rb +7 -0
- data/test/models/active_record_models.rb +122 -0
- data/test/models/article.rb +15 -0
- data/test/models/mongoid_models.rb +97 -0
- data/test/models/persistent_article.rb +11 -0
- data/test/models/persistent_article_in_namespace.rb +12 -0
- data/test/models/persistent_article_with_casting.rb +28 -0
- data/test/models/persistent_article_with_defaults.rb +11 -0
- data/test/models/persistent_articles_with_custom_index_name.rb +10 -0
- data/test/models/supermodel_article.rb +17 -0
- data/test/models/validated_model.rb +11 -0
- data/test/test_helper.rb +93 -0
- data/test/unit/active_model_lint_test.rb +17 -0
- data/test/unit/configuration_test.rb +74 -0
- data/test/unit/http_client_test.rb +76 -0
- data/test/unit/http_response_test.rb +49 -0
- data/test/unit/index_alias_test.rb +275 -0
- data/test/unit/index_test.rb +894 -0
- data/test/unit/logger_test.rb +125 -0
- data/test/unit/model_callbacks_test.rb +116 -0
- data/test/unit/model_import_test.rb +71 -0
- data/test/unit/model_persistence_test.rb +528 -0
- data/test/unit/model_search_test.rb +913 -0
- data/test/unit/results_collection_test.rb +281 -0
- data/test/unit/results_item_test.rb +162 -0
- data/test/unit/rubyext_test.rb +66 -0
- data/test/unit/search_facet_test.rb +153 -0
- data/test/unit/search_filter_test.rb +42 -0
- data/test/unit/search_highlight_test.rb +46 -0
- data/test/unit/search_query_test.rb +301 -0
- data/test/unit/search_scan_test.rb +113 -0
- data/test/unit/search_script_field_test.rb +26 -0
- data/test/unit/search_sort_test.rb +50 -0
- data/test/unit/search_test.rb +499 -0
- data/test/unit/tire_test.rb +126 -0
- data/tire.gemspec +90 -0
- metadata +549 -0
@@ -0,0 +1,126 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Tire
|
4
|
+
|
5
|
+
class TireTest < Test::Unit::TestCase
|
6
|
+
|
7
|
+
context "Tire" do
|
8
|
+
|
9
|
+
should "have the DSL methods available" do
|
10
|
+
assert_respond_to Tire, :search
|
11
|
+
assert_respond_to Tire, :index
|
12
|
+
assert_respond_to Tire, :configure
|
13
|
+
end
|
14
|
+
|
15
|
+
context "DSL" do
|
16
|
+
|
17
|
+
should "allow searching with a block" do
|
18
|
+
Search::Search.expects(:new).returns( stub(:perform => true) )
|
19
|
+
|
20
|
+
Tire.search 'dummy' do
|
21
|
+
query 'foo'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
should "allow searching with a Ruby Hash" do
|
26
|
+
payload = { :query => { :query_string => { :query => 'foo' } } }
|
27
|
+
Search::Search.expects(:new).with('dummy', :payload => payload).returns( stub(:perform => true) )
|
28
|
+
|
29
|
+
Tire.search 'dummy', payload
|
30
|
+
end
|
31
|
+
|
32
|
+
should "allow searching with a JSON string" do
|
33
|
+
payload = '{"query":{"query_string":{"query":"foo"}}}'
|
34
|
+
Search::Search.expects(:new).with('dummy', :payload => payload).returns( stub(:perform => true) )
|
35
|
+
|
36
|
+
Tire.search 'dummy', payload
|
37
|
+
end
|
38
|
+
|
39
|
+
should "raise an error when passed incorrect payload" do
|
40
|
+
assert_raise(ArgumentError) do
|
41
|
+
Tire.search 'dummy', 1
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
should "raise SearchRequestFailed when receiving bad response from backend" do
|
46
|
+
assert_raise(Search::SearchRequestFailed) do
|
47
|
+
Tire::Configuration.client.expects(:get).returns( mock_response('INDEX DOES NOT EXIST', 404) )
|
48
|
+
Tire.search('not-existing', :query => { :query_string => { :query => 'foo' }}).results
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
context "when retrieving results" do
|
53
|
+
|
54
|
+
should "not call the #perform method immediately" do
|
55
|
+
s = Tire.search('dummy') { query { string 'foo' } }
|
56
|
+
s.expects(:perform).never
|
57
|
+
end
|
58
|
+
|
59
|
+
should "call #perform from #results" do
|
60
|
+
s = Tire.search('dummy') { query { string 'foo' } }
|
61
|
+
s.expects(:perform).once
|
62
|
+
s.results
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
context "when scanning an index" do
|
68
|
+
|
69
|
+
should "initiate the scan" do
|
70
|
+
Search::Scan.expects(:new).with { |index,options| index == 'dummy' }
|
71
|
+
|
72
|
+
Tire.scan('dummy')
|
73
|
+
end
|
74
|
+
|
75
|
+
should "allow to pass the query as a block to scan" do
|
76
|
+
Search::Scan.expects(:new).with do |index,options|
|
77
|
+
index == 'dummy'
|
78
|
+
end
|
79
|
+
|
80
|
+
Tire.scan('dummy') { query { string 'foo' } }
|
81
|
+
end
|
82
|
+
|
83
|
+
should "allow to pass the query as a hash to scan" do
|
84
|
+
payload = { :query => { :query_string => { :query => 'foo' } } }
|
85
|
+
Search::Scan.expects(:new).with('dummy', payload)
|
86
|
+
|
87
|
+
Tire.scan 'dummy', payload
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
context "aliases" do
|
94
|
+
|
95
|
+
should "list all aliases" do
|
96
|
+
json = {'dummy' => {'aliases' => {'foo' => {}}}}.to_json
|
97
|
+
Configuration.client.expects(:get).returns(mock_response(json))
|
98
|
+
|
99
|
+
aliases = Tire.aliases
|
100
|
+
|
101
|
+
assert_equal 'foo', aliases.first.name
|
102
|
+
assert_equal ['dummy'], aliases.first.indices.to_a
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
context "utils" do
|
108
|
+
|
109
|
+
should "encode a string for URL" do
|
110
|
+
assert_equal 'foo+bar', Utils.escape('foo bar')
|
111
|
+
assert_equal 'foo%2Fbar', Utils.escape('foo/bar')
|
112
|
+
assert_equal 'foo%21', Utils.escape('foo!')
|
113
|
+
end
|
114
|
+
|
115
|
+
should "encode a string from URL" do
|
116
|
+
assert_equal 'foo bar', Utils.unescape('foo+bar')
|
117
|
+
assert_equal 'foo/bar', Utils.unescape('foo%2Fbar')
|
118
|
+
assert_equal 'foo!', Utils.unescape('foo%21')
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
125
|
+
|
126
|
+
end
|
data/tire.gemspec
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "tire/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "load_balanced_tire"
|
7
|
+
s.version = 0.1
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.summary = "Ruby client for ElasticSearch w/ load balancing via load_balance_client"
|
10
|
+
s.homepage = "http://github.com/themattray/tire"
|
11
|
+
s.authors = [ 'Karel Minarik', 'Matt Ray' ]
|
12
|
+
s.email = 'themattray@gmail.com'
|
13
|
+
|
14
|
+
s.rubyforge_project = "load_balanced_tire"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
s.extra_rdoc_files = [ "README.markdown", "MIT-LICENSE" ]
|
23
|
+
s.rdoc_options = [ "--charset=UTF-8" ]
|
24
|
+
|
25
|
+
s.required_rubygems_version = ">= 1.3.6"
|
26
|
+
|
27
|
+
# = Library dependencies
|
28
|
+
#
|
29
|
+
s.add_dependency "rake"
|
30
|
+
#s.add_dependency "rest-client", "~> 1.6"
|
31
|
+
s.add_dependency "load_balance_client"
|
32
|
+
s.add_dependency "multi_json", "~> 1.0"
|
33
|
+
s.add_dependency "activemodel", ">= 3.0"
|
34
|
+
s.add_dependency "hashr", "~> 0.0.19"
|
35
|
+
s.add_dependency "rack", ">= 1.4" if defined?(RUBY_VERSION) && RUBY_VERSION < '1.9'
|
36
|
+
|
37
|
+
# = Development dependencies
|
38
|
+
#
|
39
|
+
s.add_development_dependency "bundler", "~> 1.0"
|
40
|
+
s.add_development_dependency "yajl-ruby", "~> 1.0"
|
41
|
+
s.add_development_dependency "shoulda"
|
42
|
+
s.add_development_dependency "mocha"
|
43
|
+
s.add_development_dependency "activerecord", ">= 3.0"
|
44
|
+
s.add_development_dependency "sqlite3"
|
45
|
+
s.add_development_dependency "mongoid", "~> 2.2"
|
46
|
+
s.add_development_dependency "bson_ext"
|
47
|
+
s.add_development_dependency "redis-persistence"
|
48
|
+
s.add_development_dependency "curb"
|
49
|
+
s.add_development_dependency "minitest"
|
50
|
+
s.add_development_dependency "turn", "~> 0.9" if defined?(RUBY_VERSION) && RUBY_VERSION > '1.9'
|
51
|
+
|
52
|
+
# These gems are not needed for CI at <http://travis-ci.org/#!/karmi/tire>
|
53
|
+
#
|
54
|
+
unless ENV["CI"]
|
55
|
+
s.add_development_dependency "rdoc"
|
56
|
+
end
|
57
|
+
|
58
|
+
s.description = <<-DESC
|
59
|
+
Tire is a Ruby client for the ElasticSearch search engine/database.
|
60
|
+
|
61
|
+
It provides Ruby-like API for fluent communication with the ElasticSearch server
|
62
|
+
and blends with ActiveModel class for convenient usage in Rails applications.
|
63
|
+
|
64
|
+
It allows to delete and create indices, define mapping for them, supports
|
65
|
+
the bulk API, and presents an easy-to-use DSL for constructing your queries.
|
66
|
+
|
67
|
+
It has full ActiveRecord/ActiveModel compatibility, allowing you to index
|
68
|
+
your models (incrementally upon saving, or in bulk), searching and
|
69
|
+
paginating the results.
|
70
|
+
|
71
|
+
Please check the documentation at <http://karmi.github.com/tire/>.
|
72
|
+
|
73
|
+
It has been modified to use the load_balance_client gem instead of the
|
74
|
+
rest-client to support multiple elasticsearch servers with failover.
|
75
|
+
|
76
|
+
DESC
|
77
|
+
|
78
|
+
s.post_install_message =<<-CHANGELOG.gsub(/^ /, '')
|
79
|
+
================================================================================
|
80
|
+
|
81
|
+
Please check the documentation at <http://karmi.github.com/tire/>.
|
82
|
+
|
83
|
+
--------------------------------------------------------------------------------
|
84
|
+
|
85
|
+
#{Tire::CHANGELOG}
|
86
|
+
See the full changelog at <http://github.com/karmi/tire/commits/v#{Tire::VERSION}>.
|
87
|
+
|
88
|
+
--------------------------------------------------------------------------------
|
89
|
+
CHANGELOG
|
90
|
+
end
|
metadata
ADDED
@@ -0,0 +1,549 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: load_balanced_tire
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Karel Minarik
|
9
|
+
- Matt Ray
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2012-08-08 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rake
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: load_balance_client
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
type: :runtime
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: multi_json
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.0'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '1.0'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: activemodel
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '3.0'
|
71
|
+
type: :runtime
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '3.0'
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: hashr
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ~>
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 0.0.19
|
87
|
+
type: :runtime
|
88
|
+
prerelease: false
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ~>
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 0.0.19
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: bundler
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ~>
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '1.0'
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: yajl-ruby
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ~>
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '1.0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ~>
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '1.0'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: shoulda
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
none: false
|
131
|
+
requirements:
|
132
|
+
- - ! '>='
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
type: :development
|
136
|
+
prerelease: false
|
137
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: mocha
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
146
|
+
none: false
|
147
|
+
requirements:
|
148
|
+
- - ! '>='
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
type: :development
|
152
|
+
prerelease: false
|
153
|
+
version_requirements: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ! '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: activerecord
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
none: false
|
163
|
+
requirements:
|
164
|
+
- - ! '>='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '3.0'
|
167
|
+
type: :development
|
168
|
+
prerelease: false
|
169
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
|
+
none: false
|
171
|
+
requirements:
|
172
|
+
- - ! '>='
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '3.0'
|
175
|
+
- !ruby/object:Gem::Dependency
|
176
|
+
name: sqlite3
|
177
|
+
requirement: !ruby/object:Gem::Requirement
|
178
|
+
none: false
|
179
|
+
requirements:
|
180
|
+
- - ! '>='
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '0'
|
183
|
+
type: :development
|
184
|
+
prerelease: false
|
185
|
+
version_requirements: !ruby/object:Gem::Requirement
|
186
|
+
none: false
|
187
|
+
requirements:
|
188
|
+
- - ! '>='
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
191
|
+
- !ruby/object:Gem::Dependency
|
192
|
+
name: mongoid
|
193
|
+
requirement: !ruby/object:Gem::Requirement
|
194
|
+
none: false
|
195
|
+
requirements:
|
196
|
+
- - ~>
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: '2.2'
|
199
|
+
type: :development
|
200
|
+
prerelease: false
|
201
|
+
version_requirements: !ruby/object:Gem::Requirement
|
202
|
+
none: false
|
203
|
+
requirements:
|
204
|
+
- - ~>
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: '2.2'
|
207
|
+
- !ruby/object:Gem::Dependency
|
208
|
+
name: bson_ext
|
209
|
+
requirement: !ruby/object:Gem::Requirement
|
210
|
+
none: false
|
211
|
+
requirements:
|
212
|
+
- - ! '>='
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '0'
|
215
|
+
type: :development
|
216
|
+
prerelease: false
|
217
|
+
version_requirements: !ruby/object:Gem::Requirement
|
218
|
+
none: false
|
219
|
+
requirements:
|
220
|
+
- - ! '>='
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: redis-persistence
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
none: false
|
227
|
+
requirements:
|
228
|
+
- - ! '>='
|
229
|
+
- !ruby/object:Gem::Version
|
230
|
+
version: '0'
|
231
|
+
type: :development
|
232
|
+
prerelease: false
|
233
|
+
version_requirements: !ruby/object:Gem::Requirement
|
234
|
+
none: false
|
235
|
+
requirements:
|
236
|
+
- - ! '>='
|
237
|
+
- !ruby/object:Gem::Version
|
238
|
+
version: '0'
|
239
|
+
- !ruby/object:Gem::Dependency
|
240
|
+
name: curb
|
241
|
+
requirement: !ruby/object:Gem::Requirement
|
242
|
+
none: false
|
243
|
+
requirements:
|
244
|
+
- - ! '>='
|
245
|
+
- !ruby/object:Gem::Version
|
246
|
+
version: '0'
|
247
|
+
type: :development
|
248
|
+
prerelease: false
|
249
|
+
version_requirements: !ruby/object:Gem::Requirement
|
250
|
+
none: false
|
251
|
+
requirements:
|
252
|
+
- - ! '>='
|
253
|
+
- !ruby/object:Gem::Version
|
254
|
+
version: '0'
|
255
|
+
- !ruby/object:Gem::Dependency
|
256
|
+
name: minitest
|
257
|
+
requirement: !ruby/object:Gem::Requirement
|
258
|
+
none: false
|
259
|
+
requirements:
|
260
|
+
- - ! '>='
|
261
|
+
- !ruby/object:Gem::Version
|
262
|
+
version: '0'
|
263
|
+
type: :development
|
264
|
+
prerelease: false
|
265
|
+
version_requirements: !ruby/object:Gem::Requirement
|
266
|
+
none: false
|
267
|
+
requirements:
|
268
|
+
- - ! '>='
|
269
|
+
- !ruby/object:Gem::Version
|
270
|
+
version: '0'
|
271
|
+
- !ruby/object:Gem::Dependency
|
272
|
+
name: turn
|
273
|
+
requirement: !ruby/object:Gem::Requirement
|
274
|
+
none: false
|
275
|
+
requirements:
|
276
|
+
- - ~>
|
277
|
+
- !ruby/object:Gem::Version
|
278
|
+
version: '0.9'
|
279
|
+
type: :development
|
280
|
+
prerelease: false
|
281
|
+
version_requirements: !ruby/object:Gem::Requirement
|
282
|
+
none: false
|
283
|
+
requirements:
|
284
|
+
- - ~>
|
285
|
+
- !ruby/object:Gem::Version
|
286
|
+
version: '0.9'
|
287
|
+
- !ruby/object:Gem::Dependency
|
288
|
+
name: rdoc
|
289
|
+
requirement: !ruby/object:Gem::Requirement
|
290
|
+
none: false
|
291
|
+
requirements:
|
292
|
+
- - ! '>='
|
293
|
+
- !ruby/object:Gem::Version
|
294
|
+
version: '0'
|
295
|
+
type: :development
|
296
|
+
prerelease: false
|
297
|
+
version_requirements: !ruby/object:Gem::Requirement
|
298
|
+
none: false
|
299
|
+
requirements:
|
300
|
+
- - ! '>='
|
301
|
+
- !ruby/object:Gem::Version
|
302
|
+
version: '0'
|
303
|
+
description: ! " Tire is a Ruby client for the ElasticSearch search engine/database.\n\n
|
304
|
+
\ It provides Ruby-like API for fluent communication with the ElasticSearch server\n
|
305
|
+
\ and blends with ActiveModel class for convenient usage in Rails applications.\n\n
|
306
|
+
\ It allows to delete and create indices, define mapping for them, supports\n the
|
307
|
+
bulk API, and presents an easy-to-use DSL for constructing your queries.\n\n It
|
308
|
+
has full ActiveRecord/ActiveModel compatibility, allowing you to index\n your
|
309
|
+
models (incrementally upon saving, or in bulk), searching and\n paginating the
|
310
|
+
results.\n\n Please check the documentation at <http://karmi.github.com/tire/>.\n\n
|
311
|
+
\ It has been modified to use the load_balance_client gem instead of the\n rest-client
|
312
|
+
to support multiple elasticsearch servers with failover.\n\n"
|
313
|
+
email: themattray@gmail.com
|
314
|
+
executables: []
|
315
|
+
extensions: []
|
316
|
+
extra_rdoc_files:
|
317
|
+
- README.markdown
|
318
|
+
- MIT-LICENSE
|
319
|
+
files:
|
320
|
+
- .gitignore
|
321
|
+
- .travis.yml
|
322
|
+
- Gemfile
|
323
|
+
- MIT-LICENSE
|
324
|
+
- README.markdown
|
325
|
+
- Rakefile
|
326
|
+
- examples/rails-application-template.rb
|
327
|
+
- examples/tire-dsl.rb
|
328
|
+
- lib/tire.rb
|
329
|
+
- lib/tire/alias.rb
|
330
|
+
- lib/tire/configuration.rb
|
331
|
+
- lib/tire/dsl.rb
|
332
|
+
- lib/tire/http/client.rb
|
333
|
+
- lib/tire/http/clients/curb.rb
|
334
|
+
- lib/tire/http/clients/faraday.rb
|
335
|
+
- lib/tire/http/response.rb
|
336
|
+
- lib/tire/index.rb
|
337
|
+
- lib/tire/logger.rb
|
338
|
+
- lib/tire/model/callbacks.rb
|
339
|
+
- lib/tire/model/import.rb
|
340
|
+
- lib/tire/model/indexing.rb
|
341
|
+
- lib/tire/model/naming.rb
|
342
|
+
- lib/tire/model/percolate.rb
|
343
|
+
- lib/tire/model/persistence.rb
|
344
|
+
- lib/tire/model/persistence/attributes.rb
|
345
|
+
- lib/tire/model/persistence/finders.rb
|
346
|
+
- lib/tire/model/persistence/storage.rb
|
347
|
+
- lib/tire/model/search.rb
|
348
|
+
- lib/tire/results/collection.rb
|
349
|
+
- lib/tire/results/item.rb
|
350
|
+
- lib/tire/results/pagination.rb
|
351
|
+
- lib/tire/rubyext/hash.rb
|
352
|
+
- lib/tire/rubyext/ruby_1_8.rb
|
353
|
+
- lib/tire/rubyext/symbol.rb
|
354
|
+
- lib/tire/search.rb
|
355
|
+
- lib/tire/search/facet.rb
|
356
|
+
- lib/tire/search/filter.rb
|
357
|
+
- lib/tire/search/highlight.rb
|
358
|
+
- lib/tire/search/query.rb
|
359
|
+
- lib/tire/search/scan.rb
|
360
|
+
- lib/tire/search/script_field.rb
|
361
|
+
- lib/tire/search/sort.rb
|
362
|
+
- lib/tire/tasks.rb
|
363
|
+
- lib/tire/utils.rb
|
364
|
+
- lib/tire/version.rb
|
365
|
+
- test/fixtures/articles/1.json
|
366
|
+
- test/fixtures/articles/2.json
|
367
|
+
- test/fixtures/articles/3.json
|
368
|
+
- test/fixtures/articles/4.json
|
369
|
+
- test/fixtures/articles/5.json
|
370
|
+
- test/integration/active_model_indexing_test.rb
|
371
|
+
- test/integration/active_model_searchable_test.rb
|
372
|
+
- test/integration/active_record_searchable_test.rb
|
373
|
+
- test/integration/boolean_queries_test.rb
|
374
|
+
- test/integration/count_test.rb
|
375
|
+
- test/integration/custom_score_queries_test.rb
|
376
|
+
- test/integration/dis_max_queries_test.rb
|
377
|
+
- test/integration/dsl_search_test.rb
|
378
|
+
- test/integration/explanation_test.rb
|
379
|
+
- test/integration/facets_test.rb
|
380
|
+
- test/integration/filtered_queries_test.rb
|
381
|
+
- test/integration/filters_test.rb
|
382
|
+
- test/integration/fuzzy_queries_test.rb
|
383
|
+
- test/integration/highlight_test.rb
|
384
|
+
- test/integration/index_aliases_test.rb
|
385
|
+
- test/integration/index_mapping_test.rb
|
386
|
+
- test/integration/index_store_test.rb
|
387
|
+
- test/integration/index_update_document_test.rb
|
388
|
+
- test/integration/mongoid_searchable_test.rb
|
389
|
+
- test/integration/percolator_test.rb
|
390
|
+
- test/integration/persistent_model_test.rb
|
391
|
+
- test/integration/prefix_query_test.rb
|
392
|
+
- test/integration/query_return_version_test.rb
|
393
|
+
- test/integration/query_string_test.rb
|
394
|
+
- test/integration/range_queries_test.rb
|
395
|
+
- test/integration/reindex_test.rb
|
396
|
+
- test/integration/results_test.rb
|
397
|
+
- test/integration/scan_test.rb
|
398
|
+
- test/integration/script_fields_test.rb
|
399
|
+
- test/integration/sort_test.rb
|
400
|
+
- test/integration/text_query_test.rb
|
401
|
+
- test/models/active_model_article.rb
|
402
|
+
- test/models/active_model_article_with_callbacks.rb
|
403
|
+
- test/models/active_model_article_with_custom_document_type.rb
|
404
|
+
- test/models/active_model_article_with_custom_index_name.rb
|
405
|
+
- test/models/active_record_models.rb
|
406
|
+
- test/models/article.rb
|
407
|
+
- test/models/mongoid_models.rb
|
408
|
+
- test/models/persistent_article.rb
|
409
|
+
- test/models/persistent_article_in_namespace.rb
|
410
|
+
- test/models/persistent_article_with_casting.rb
|
411
|
+
- test/models/persistent_article_with_defaults.rb
|
412
|
+
- test/models/persistent_articles_with_custom_index_name.rb
|
413
|
+
- test/models/supermodel_article.rb
|
414
|
+
- test/models/validated_model.rb
|
415
|
+
- test/test_helper.rb
|
416
|
+
- test/unit/active_model_lint_test.rb
|
417
|
+
- test/unit/configuration_test.rb
|
418
|
+
- test/unit/http_client_test.rb
|
419
|
+
- test/unit/http_response_test.rb
|
420
|
+
- test/unit/index_alias_test.rb
|
421
|
+
- test/unit/index_test.rb
|
422
|
+
- test/unit/logger_test.rb
|
423
|
+
- test/unit/model_callbacks_test.rb
|
424
|
+
- test/unit/model_import_test.rb
|
425
|
+
- test/unit/model_persistence_test.rb
|
426
|
+
- test/unit/model_search_test.rb
|
427
|
+
- test/unit/results_collection_test.rb
|
428
|
+
- test/unit/results_item_test.rb
|
429
|
+
- test/unit/rubyext_test.rb
|
430
|
+
- test/unit/search_facet_test.rb
|
431
|
+
- test/unit/search_filter_test.rb
|
432
|
+
- test/unit/search_highlight_test.rb
|
433
|
+
- test/unit/search_query_test.rb
|
434
|
+
- test/unit/search_scan_test.rb
|
435
|
+
- test/unit/search_script_field_test.rb
|
436
|
+
- test/unit/search_sort_test.rb
|
437
|
+
- test/unit/search_test.rb
|
438
|
+
- test/unit/tire_test.rb
|
439
|
+
- tire.gemspec
|
440
|
+
homepage: http://github.com/themattray/tire
|
441
|
+
licenses: []
|
442
|
+
post_install_message: ! "================================================================================\n\n
|
443
|
+
\ Please check the documentation at <http://karmi.github.com/tire/>.\n\n--------------------------------------------------------------------------------\n\n
|
444
|
+
\ IMPORTANT CHANGES LATELY:\n\n Version 0.4.1\n -------------\n * Added a Index#settings
|
445
|
+
method to retrieve index settings as a Hash\n * Added support for the \"scan\"
|
446
|
+
search in the Ruby API\n * Added support for reindexing the index documents into
|
447
|
+
new index\n * Added basic support for index aliases\n * Changed, that Index#bulk_store
|
448
|
+
runs against an index endpoint, not against `/_bulk`\n * Refactorings, fixes, Ruby
|
449
|
+
1.8 compatibility\n\n Version 0.4.2\n -------------\n * Fixed incorrect handling
|
450
|
+
of PUT requests in the Curb client\n * Fixed, that blocks passed to `Tire::Index.new`
|
451
|
+
or `Tire.index` losed the scope\n * Added `Tire::Alias`, interface and DSL to manage
|
452
|
+
aliases as resources\n\n See the full changelog at <http://github.com/karmi/tire/commits/v0.4.2>.\n\n--------------------------------------------------------------------------------\n"
|
453
|
+
rdoc_options:
|
454
|
+
- --charset=UTF-8
|
455
|
+
require_paths:
|
456
|
+
- lib
|
457
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
458
|
+
none: false
|
459
|
+
requirements:
|
460
|
+
- - ! '>='
|
461
|
+
- !ruby/object:Gem::Version
|
462
|
+
version: '0'
|
463
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
464
|
+
none: false
|
465
|
+
requirements:
|
466
|
+
- - ! '>='
|
467
|
+
- !ruby/object:Gem::Version
|
468
|
+
version: 1.3.6
|
469
|
+
requirements: []
|
470
|
+
rubyforge_project: load_balanced_tire
|
471
|
+
rubygems_version: 1.8.24
|
472
|
+
signing_key:
|
473
|
+
specification_version: 3
|
474
|
+
summary: Ruby client for ElasticSearch w/ load balancing via load_balance_client
|
475
|
+
test_files:
|
476
|
+
- test/fixtures/articles/1.json
|
477
|
+
- test/fixtures/articles/2.json
|
478
|
+
- test/fixtures/articles/3.json
|
479
|
+
- test/fixtures/articles/4.json
|
480
|
+
- test/fixtures/articles/5.json
|
481
|
+
- test/integration/active_model_indexing_test.rb
|
482
|
+
- test/integration/active_model_searchable_test.rb
|
483
|
+
- test/integration/active_record_searchable_test.rb
|
484
|
+
- test/integration/boolean_queries_test.rb
|
485
|
+
- test/integration/count_test.rb
|
486
|
+
- test/integration/custom_score_queries_test.rb
|
487
|
+
- test/integration/dis_max_queries_test.rb
|
488
|
+
- test/integration/dsl_search_test.rb
|
489
|
+
- test/integration/explanation_test.rb
|
490
|
+
- test/integration/facets_test.rb
|
491
|
+
- test/integration/filtered_queries_test.rb
|
492
|
+
- test/integration/filters_test.rb
|
493
|
+
- test/integration/fuzzy_queries_test.rb
|
494
|
+
- test/integration/highlight_test.rb
|
495
|
+
- test/integration/index_aliases_test.rb
|
496
|
+
- test/integration/index_mapping_test.rb
|
497
|
+
- test/integration/index_store_test.rb
|
498
|
+
- test/integration/index_update_document_test.rb
|
499
|
+
- test/integration/mongoid_searchable_test.rb
|
500
|
+
- test/integration/percolator_test.rb
|
501
|
+
- test/integration/persistent_model_test.rb
|
502
|
+
- test/integration/prefix_query_test.rb
|
503
|
+
- test/integration/query_return_version_test.rb
|
504
|
+
- test/integration/query_string_test.rb
|
505
|
+
- test/integration/range_queries_test.rb
|
506
|
+
- test/integration/reindex_test.rb
|
507
|
+
- test/integration/results_test.rb
|
508
|
+
- test/integration/scan_test.rb
|
509
|
+
- test/integration/script_fields_test.rb
|
510
|
+
- test/integration/sort_test.rb
|
511
|
+
- test/integration/text_query_test.rb
|
512
|
+
- test/models/active_model_article.rb
|
513
|
+
- test/models/active_model_article_with_callbacks.rb
|
514
|
+
- test/models/active_model_article_with_custom_document_type.rb
|
515
|
+
- test/models/active_model_article_with_custom_index_name.rb
|
516
|
+
- test/models/active_record_models.rb
|
517
|
+
- test/models/article.rb
|
518
|
+
- test/models/mongoid_models.rb
|
519
|
+
- test/models/persistent_article.rb
|
520
|
+
- test/models/persistent_article_in_namespace.rb
|
521
|
+
- test/models/persistent_article_with_casting.rb
|
522
|
+
- test/models/persistent_article_with_defaults.rb
|
523
|
+
- test/models/persistent_articles_with_custom_index_name.rb
|
524
|
+
- test/models/supermodel_article.rb
|
525
|
+
- test/models/validated_model.rb
|
526
|
+
- test/test_helper.rb
|
527
|
+
- test/unit/active_model_lint_test.rb
|
528
|
+
- test/unit/configuration_test.rb
|
529
|
+
- test/unit/http_client_test.rb
|
530
|
+
- test/unit/http_response_test.rb
|
531
|
+
- test/unit/index_alias_test.rb
|
532
|
+
- test/unit/index_test.rb
|
533
|
+
- test/unit/logger_test.rb
|
534
|
+
- test/unit/model_callbacks_test.rb
|
535
|
+
- test/unit/model_import_test.rb
|
536
|
+
- test/unit/model_persistence_test.rb
|
537
|
+
- test/unit/model_search_test.rb
|
538
|
+
- test/unit/results_collection_test.rb
|
539
|
+
- test/unit/results_item_test.rb
|
540
|
+
- test/unit/rubyext_test.rb
|
541
|
+
- test/unit/search_facet_test.rb
|
542
|
+
- test/unit/search_filter_test.rb
|
543
|
+
- test/unit/search_highlight_test.rb
|
544
|
+
- test/unit/search_query_test.rb
|
545
|
+
- test/unit/search_scan_test.rb
|
546
|
+
- test/unit/search_script_field_test.rb
|
547
|
+
- test/unit/search_sort_test.rb
|
548
|
+
- test/unit/search_test.rb
|
549
|
+
- test/unit/tire_test.rb
|