Skip to content

Commit 058d810

Browse files
committed
[STORE] Update Sinatra app
1 parent 82ec11f commit 058d810

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

elasticsearch-persistence/examples/notes/application.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,19 @@ def __truncate_text
5454

5555
class NoteRepository
5656
include Elasticsearch::Persistence::Repository
57+
include Elasticsearch::Persistence::Repository::DSL
5758

5859
client Elasticsearch::Client.new url: ENV['ELASTICSEARCH_URL'], log: true
5960

60-
index :notes
61-
type :note
61+
index_name :notes
62+
document_type :note
6263

6364
mapping do
6465
indexes :text, analyzer: 'snowball'
6566
indexes :tags, type: 'keyword'
6667
indexes :created_at, type: 'date'
6768
end
6869

69-
create_index!
70-
7170
def deserialize(document)
7271
Note.new document['_source'].merge('id' => document['_id'])
7372
end

0 commit comments

Comments
 (0)