@@ -269,8 +269,8 @@ It is possible to search across multiple models with the module method:
269269``` ruby
270270Elasticsearch ::Model .search(' fox' , [Article , Comment ]).results.to_a.map(& :to_hash )
271271# => [
272- # {"_index"=>"articles", "_type"=>"article", " _id"=>"1", "_score"=>0.35136628, "_source"=>...},
273- # {"_index"=>"comments", "_type"=>"comment", " _id"=>"1", "_score"=>0.35136628, "_source"=>...}
272+ # {"_index"=>"articles", "_id"=>"1", "_score"=>0.35136628, "_source"=>...},
273+ # {"_index"=>"comments", "_id"=>"1", "_score"=>0.35136628, "_source"=>...}
274274# ]
275275
276276Elasticsearch ::Model .search(' fox' , [Article , Comment ]).records.to_a
@@ -415,13 +415,11 @@ Article.__elasticsearch__.create_index! force: true
415415Article .__elasticsearch__ .refresh_index!
416416```
417417
418- By default, index name and document type will be inferred from your class name,
419- you can set it explicitly, however:
418+ By default, index name will be inferred from your class name, you can set it explicitly, however:
420419
421420``` ruby
422421class Article
423422 index_name " articles-#{ Rails .env} "
424- document_type " post"
425423end
426424```
427425
@@ -529,10 +527,10 @@ class Indexer
529527 case operation.to_s
530528 when /index/
531529 record = Article .find(record_id)
532- Client .index index: ' articles' , type: ' article ' , id: record.id, body: record.__elasticsearch__ .as_indexed_json
530+ Client .index index: ' articles' , id: record.id, body: record.__elasticsearch__ .as_indexed_json
533531 when /delete/
534532 begin
535- Client .delete index: ' articles' , type: ' article ' , id: record_id
533+ Client .delete index: ' articles' , id: record_id
536534 rescue Elastic ::Transport ::Transport ::Errors ::NotFound
537535 logger.debug " Article not found, ID: #{ record_id } "
538536 end
@@ -555,7 +553,7 @@ You'll see the job being processed in the console where you started the _Sidekiq
555553Indexer JID-eb7e2daf389a1e5e83697128 DEBUG: ["index", "ID: 7"]
556554Indexer JID-eb7e2daf389a1e5e83697128 INFO: PUT http://localhost:9200/articles/article/1 [status:200, request:0.004s, query:n/a]
557555Indexer JID-eb7e2daf389a1e5e83697128 DEBUG: > {"id":1,"title":"Updated", ...}
558- Indexer JID-eb7e2daf389a1e5e83697128 DEBUG: < {"ok":true,"_index":"articles","_type":"article"," _id":"1","_version":6}
556+ Indexer JID-eb7e2daf389a1e5e83697128 DEBUG: < {"ok":true,"_index":"articles","_id":"1","_version":6}
559557Indexer JID-eb7e2daf389a1e5e83697128 INFO: done: 0.006 sec
560558```
561559
0 commit comments