elasticsearch-rails 6.1.1 → 7.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,20 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  # A collection of Rake tasks to facilitate importing data from your models into Elasticsearch.
2
19
  #
3
20
  # Add this e.g. into the `lib/tasks/elasticsearch.rake` file in your Rails application:
@@ -1,5 +1,22 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  module Elasticsearch
2
19
  module Rails
3
- VERSION = '6.1.1'
20
+ VERSION = "7.2.1"
4
21
  end
5
22
  end
@@ -1,3 +1,20 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  require "elasticsearch/rails/version"
2
19
 
3
20
  module Elasticsearch
@@ -1,3 +1,20 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  # =====================================================================================================
2
19
  # Template for generating a no-frills Rails application with support for Elasticsearch full-text search
3
20
  # =====================================================================================================
@@ -15,7 +32,7 @@
15
32
  # Usage:
16
33
  # ------
17
34
  #
18
- # $ rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/01-basic.rb
35
+ # $ rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/01-basic.rb
19
36
  #
20
37
  # =====================================================================================================
21
38
 
@@ -27,7 +44,7 @@ $elasticsearch_url = ENV.fetch('ELASTICSEARCH_URL', 'http://localhost:9200')
27
44
 
28
45
  # ----- Check for Elasticsearch -------------------------------------------------------------------
29
46
 
30
- required_elasticsearch_version = '6'
47
+ required_elasticsearch_version = '7'
31
48
 
32
49
  docker_command =<<-CMD.gsub(/\s{1,}/, ' ').strip
33
50
  docker run \
@@ -37,7 +54,7 @@ docker_command =<<-CMD.gsub(/\s{1,}/, ' ').strip
37
54
  --env "cluster.name=elasticsearch-rails" \
38
55
  --env "cluster.routing.allocation.disk.threshold_enabled=false" \
39
56
  --rm \
40
- docker.elastic.co/elasticsearch/elasticsearch-oss:6.4.0
57
+ docker.elastic.co/elasticsearch/elasticsearch-oss:7.6.0
41
58
  CMD
42
59
 
43
60
  begin
@@ -91,11 +108,11 @@ remove_file 'README.md'
91
108
  create_file 'README.md', <<-README
92
109
  # Ruby on Rails and Elasticsearch: Example application
93
110
 
94
- This application is an example of integrating the {Elasticsearch}[http://www.elasticsearch.org]
111
+ This application is an example of integrating the {Elasticsearch}[https://www.elastic.co]
95
112
  search engine with the {Ruby On Rails}[http://rubyonrails.org] web framework.
96
113
 
97
114
  It has been generated by application templates available at
98
- https://github.com/elasticsearch/elasticsearch-rails/tree/master/elasticsearch-rails/lib/rails/templates.
115
+ https://github.com/elasticsearch/elasticsearch-rails/tree/main/elasticsearch-rails/lib/rails/templates.
99
116
 
100
117
  ## [1] Basic
101
118
 
@@ -139,7 +156,7 @@ puts
139
156
  say_status "Rubygems", "Adding Elasticsearch libraries into Gemfile...\n", :yellow
140
157
  puts '-'*80, ''; sleep 0.75
141
158
 
142
- gem 'elasticsearch', git: 'https://github.com/elasticsearch/elasticsearch-ruby.git'
159
+ gem 'elasticsearch'
143
160
  gem 'elasticsearch-model', git: 'https://github.com/elasticsearch/elasticsearch-rails.git'
144
161
  gem 'elasticsearch-rails', git: 'https://github.com/elasticsearch/elasticsearch-rails.git'
145
162
 
@@ -321,6 +338,10 @@ puts '-'*80, ''
321
338
  git tag: "basic"
322
339
  git log: "--reverse --oneline"
323
340
 
341
+ # ----- Install Webpacker -------------------------------------------------------------------------
342
+
343
+ run 'rails webpacker:install'
344
+
324
345
  # ----- Start the application ---------------------------------------------------------------------
325
346
 
326
347
  unless ENV['RAILS_NO_SERVER_START']
@@ -1,4 +1,21 @@
1
- # $ rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/02-pretty.rb
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ # $ rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/02-pretty.rb
2
19
 
3
20
  unless File.read('README.md').include? '## [1] Basic'
4
21
  say_status "ERROR", "You have to run the 01-basic.rb template first.", :red
@@ -1,4 +1,21 @@
1
- # $ rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/03-expert.rb
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ # $ rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/03-expert.rb
2
19
 
3
20
  unless File.read('README.md').include? '## [2] Pretty'
4
21
  say_status "ERROR", "You have to run the 01-basic.rb and 02-pretty.rb templates first.", :red
@@ -17,7 +34,8 @@ begin
17
34
  rescue Redis::CannotConnectError
18
35
  puts
19
36
  say_status "ERROR", "Redis not available", :red
20
- say_status "", "This template uses an asynchronous indexer via Sidekiq, and requires a running Redis server."
37
+ say_status "", "This template uses an asynchronous indexer via Sidekiq, and requires a running Redis server.
38
+ Make sure you have installed Redis (brew install redis) and that you have launched the server"
21
39
  exit(1)
22
40
  end
23
41
 
@@ -163,7 +181,7 @@ CODE
163
181
  gsub_file "test/models/article_test.rb", %r{assert_equal 'foo', definition\[:query\]\[:multi_match\]\[:query\]}, "assert_equal 'foo', definition.to_hash[:query][:bool][:should][0][:multi_match][:query]"
164
182
 
165
183
  # copy_file File.expand_path('../searchable.rb', __FILE__), 'app/models/concerns/searchable.rb'
166
- get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/searchable.rb', 'app/models/concerns/searchable.rb'
184
+ get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/searchable.rb', 'app/models/concerns/searchable.rb'
167
185
 
168
186
  insert_into_file "app/models/article.rb", after: "ActiveRecord::Base" do
169
187
  <<-CODE
@@ -191,7 +209,7 @@ gem "sidekiq"
191
209
  run "bundle install"
192
210
 
193
211
  # copy_file File.expand_path('../indexer.rb', __FILE__), 'app/workers/indexer.rb'
194
- get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/indexer.rb', 'app/workers/indexer.rb'
212
+ get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/indexer.rb', 'app/workers/indexer.rb'
195
213
 
196
214
  insert_into_file "test/test_helper.rb",
197
215
  "require 'sidekiq/testing'\n\n",
@@ -226,16 +244,16 @@ create_file 'app/controllers/search_controller.rb' do
226
244
  end
227
245
 
228
246
  # copy_file File.expand_path('../search_controller_test.rb', __FILE__), 'test/controllers/search_controller_test.rb'
229
- get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/search_controller_test.rb', 'test/controllers/search_controller_test.rb'
247
+ get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/search_controller_test.rb', 'test/controllers/search_controller_test.rb'
230
248
 
231
249
  route "get '/search', to: 'search#index', as: 'search'"
232
250
  gsub_file 'config/routes.rb', %r{root to: 'articles#index'$}, "root to: 'search#index'"
233
251
 
234
252
  # copy_file File.expand_path('../index.html.erb', __FILE__), 'app/views/search/index.html.erb'
235
- get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/index.html.erb', 'app/views/search/index.html.erb'
253
+ get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/index.html.erb', 'app/views/search/index.html.erb'
236
254
 
237
255
  # copy_file File.expand_path('../search.css', __FILE__), 'app/assets/stylesheets/search.css'
238
- get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/search.css', 'app/assets/stylesheets/search.css'
256
+ get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/search.css', 'app/assets/stylesheets/search.css'
239
257
 
240
258
  git add: "app/controllers/ test/controllers/ config/routes.rb"
241
259
  git add: "app/views/search/ app/assets/stylesheets/search.css"
@@ -297,11 +315,11 @@ say_status "Database", "Re-creating the database with data and importing into E
297
315
  puts '-'*80, ''; sleep 0.25
298
316
 
299
317
  # copy_file File.expand_path('../articles.yml.gz', __FILE__), 'db/articles.yml.gz'
300
- get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/articles.yml.gz', 'db/articles.yml.gz'
318
+ get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/articles.yml.gz', 'db/articles.yml.gz'
301
319
 
302
320
  remove_file 'db/seeds.rb'
303
321
  # copy_file File.expand_path('../seeds.rb', __FILE__), 'db/seeds.rb'
304
- get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/seeds.rb', 'db/seeds.rb'
322
+ get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/seeds.rb', 'db/seeds.rb'
305
323
 
306
324
  rake "db:reset"
307
325
  rake "environment elasticsearch:import:model CLASS='Article' BATCH=100 FORCE=y"
@@ -1,4 +1,21 @@
1
- # $ rails new searchapp --skip --skip-bundle --template https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/04-dsl.rb
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ # $ rails new searchapp --skip --skip-bundle --template https://raw.githubusercontent.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/04-dsl.rb
2
19
 
3
20
  unless File.read('README.md').include? '## [3] Expert'
4
21
  say_status "ERROR", "You have to run the 01-basic.rb, 02-pretty.rb and 03-expert.rb templates first.", :red
@@ -39,10 +56,10 @@ run "bundle install"
39
56
  # ----- Change the search definition implementation and associated views and tests ----------------
40
57
 
41
58
  # copy_file File.expand_path('../searchable.dsl.rb', __FILE__), 'app/models/concerns/searchable.rb', force: true
42
- get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/searchable.dsl.rb', 'app/models/concerns/searchable.rb', force: true
59
+ get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/searchable.dsl.rb', 'app/models/concerns/searchable.rb', force: true
43
60
 
44
61
  # copy_file File.expand_path('../index.html.dsl.erb', __FILE__), 'app/views/search/index.html.erb', force: true
45
- get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/index.html.dsl.erb', 'app/views/search/index.html.erb', force: true
62
+ get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/index.html.dsl.erb', 'app/views/search/index.html.erb', force: true
46
63
 
47
64
  gsub_file "test/controllers/search_controller_test.rb", %r{test "should return facets" do.*?end}m, <<-CODE
48
65
  test "should return aggregations" do
@@ -1,4 +1,21 @@
1
- # $ rails new searchapp --skip --skip-bundle --template https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/05-settings-files.rb
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ # $ rails new searchapp --skip --skip-bundle --template https://raw.githubusercontent.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/05-settings-files.rb
2
19
 
3
20
  # (See: 01-basic.rb, 02-pretty.rb, 03-expert.rb, 04-dsl.rb)
4
21
 
@@ -26,7 +43,7 @@ git commit: "-m 'Setup the Searchable module to load settings from file'"
26
43
  # ----- Copy the articles_settings.json file -------------------------------------------------------
27
44
 
28
45
  # copy_file File.expand_path('../articles_settings.json', __FILE__), 'config/elasticsearch/articles_settings.json'
29
- get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/articles_settings.json',
46
+ get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/main/elasticsearch-rails/lib/rails/templates/articles_settings.json',
30
47
  'config/elasticsearch/articles_settings.json', force: true
31
48
 
32
49
  git add: "config/elasticsearch/articles_settings.json"
@@ -1,3 +1,21 @@
1
+ <%#
2
+ # Licensed to Elasticsearch B.V. under one or more contributor
3
+ # license agreements. See the NOTICE file distributed with
4
+ # this work for additional information regarding copyright
5
+ # ownership. Elasticsearch B.V. licenses this file to you under
6
+ # the Apache License, Version 2.0 (the "License"); you may
7
+ # not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing,
13
+ # software distributed under the License is distributed on an
14
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ # KIND, either express or implied. See the License for the
16
+ # specific language governing permissions and limitations
17
+ # under the License.
18
+ %>
1
19
  <div class="col-md-12">
2
20
  <h1 class="text-right"><%= link_to 'Search New York Times articles', root_path %></h1>
3
21
 
@@ -1,3 +1,21 @@
1
+ <%#
2
+ # Licensed to Elasticsearch B.V. under one or more contributor
3
+ # license agreements. See the NOTICE file distributed with
4
+ # this work for additional information regarding copyright
5
+ # ownership. Elasticsearch B.V. licenses this file to you under
6
+ # the Apache License, Version 2.0 (the "License"); you may
7
+ # not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing,
13
+ # software distributed under the License is distributed on an
14
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ # KIND, either express or implied. See the License for the
16
+ # specific language governing permissions and limitations
17
+ # under the License.
18
+ %>
1
19
  <div class="col-md-12">
2
20
  <h1 class="text-right"><%= link_to 'Search New York Times articles', root_path %></h1>
3
21
 
@@ -1,3 +1,20 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  # Indexer class for <http://sidekiq.org>
2
19
  #
3
20
  # Run me with:
@@ -1,3 +1,20 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  require 'test_helper'
2
19
  require 'sidekiq/api'
3
20
 
@@ -1,3 +1,20 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  require 'test_helper'
2
19
 
3
20
  class SearchControllerTest < ActionController::TestCase
@@ -1,3 +1,20 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  module Searchable
2
19
  extend ActiveSupport::Concern
3
20
 
@@ -1,3 +1,20 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  module Searchable
2
19
  extend ActiveSupport::Concern
3
20
 
@@ -1,3 +1,20 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  require 'zlib'
2
19
  require 'yaml'
3
20
 
@@ -1,3 +1,20 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  require 'spec_helper'
2
19
 
3
20
  describe 'ActiveSupport::Instrumentation integration' do
data/spec/lograge_spec.rb CHANGED
@@ -1,3 +1,37 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+
19
+ # Licensed to Elasticsearch B.V. under one or more contributor
20
+ # license agreements. See the NOTICE file distributed with
21
+ # this work for additional information regarding copyright
22
+ # ownership. Elasticsearch B.V. licenses this file to you under
23
+ # the Apache License, Version 2.0 (the "License"); you may
24
+ # not use this file except in compliance with the License.
25
+ # You may obtain a copy of the License at
26
+ #
27
+ # http://www.apache.org/licenses/LICENSE-2.0
28
+ #
29
+ # Unless required by applicable law or agreed to in writing,
30
+ # software distributed under the License is distributed on an
31
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
32
+ # KIND, either express or implied. See the License for the
33
+ # specific language governing permissions and limitations
34
+ # under the License.
1
35
  require 'spec_helper'
2
36
  require 'action_pack'
3
37
  require 'lograge'
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,20 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  require 'pry-nav'
2
19
  require 'active_record'
3
20
  require 'elasticsearch/model'
@@ -20,6 +37,7 @@ RSpec.configure do |config|
20
37
  tracer.formatter = lambda { |s, d, p, m| "#{m.gsub(/^.*$/) { |n| ' ' + n }.ansi(:faint)}\n" }
21
38
  Elasticsearch::Model.client = Elasticsearch::Client.new host: ELASTICSEARCH_URL,
22
39
  tracer: (ENV['QUIET'] ? nil : tracer)
40
+ puts "Elasticsearch Version: #{Elasticsearch::Model.client.info['version']}"
23
41
 
24
42
  unless ActiveRecord::Base.connected?
25
43
  ActiveRecord::Base.establish_connection( :adapter => 'sqlite3', :database => ":memory:" )