We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82ec11f commit 058d810Copy full SHA for 058d810
elasticsearch-persistence/examples/notes/application.rb
@@ -54,20 +54,19 @@ def __truncate_text
54
55
class NoteRepository
56
include Elasticsearch::Persistence::Repository
57
+ include Elasticsearch::Persistence::Repository::DSL
58
59
client Elasticsearch::Client.new url: ENV['ELASTICSEARCH_URL'], log: true
60
- index :notes
61
- type :note
+ index_name :notes
62
+ document_type :note
63
64
mapping do
65
indexes :text, analyzer: 'snowball'
66
indexes :tags, type: 'keyword'
67
indexes :created_at, type: 'date'
68
end
69
- create_index!
70
-
71
def deserialize(document)
72
Note.new document['_source'].merge('id' => document['_id'])
73
0 commit comments