Skip to content

Commit

Permalink
No need to chain mapping, it is modified in-place
Browse files Browse the repository at this point in the history
  • Loading branch information
honzakral committed Jan 23, 2015
1 parent 08cb4d9 commit 778fbc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/persistence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ The mapping definition follows a similar pattern to the query dsl:
m = Mapping('my-type')
# add fields
m = m.field('title', 'string')
m.field('title', 'string')
# you can use multi-fields easily
m = m.field('category', 'string', fields={'raw': String(index='not_analyzed')})
m.field('category', 'string', fields={'raw': String(index='not_analyzed')})
# you can also create a field manually
comment = Nested().field('author', 'string').field('created_at', 'date')
# and attach it to the mapping
m = m.field('comments', comment)
m.field('comments', comment)
# you can also define mappings for the meta fields
m = m.meta('_all', enabled=False)
m.meta('_all', enabled=False)
# save the mapping into index 'my-index'
m.save('my-index')
Expand Down

0 comments on commit 778fbc0

Please sign in to comment.