Skip to content

Commit

Permalink
Added _routing and dynamic_date_formats in DocumentObjectField
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Paro committed Feb 2, 2012
1 parent 65c2a76 commit cb6eca2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pyes/mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ def __init__(self, *args, **kwargs):
class DocumentObjectField(object):
def __init__(self, name=None, type=None, path=None, properties=None,
dynamic=None, enabled=None, _all=None, _boost=None, _id=None,
_index=None, _source=None, _type=None, date_formats=None,
_parent=None, _timestamp=None, connection=None, index_name=None):
_index=None, _source=None, _type=None, date_formats=None, _routing=None,
_parent=None, _timestamp=None, connection=None, index_name=None, dynamic_date_formats=None):
self.name = name
self.type = "object"
self.path = path
Expand All @@ -343,6 +343,9 @@ def __init__(self, name=None, type=None, path=None, properties=None,
self._id = _id
self._index = _index
self._source = _source
self._routing = _routing
self.dynamic_date_formats = dynamic_date_formats

self._type = _type
if self._type is None:
self._type = {"store" : "yes"}
Expand Down Expand Up @@ -373,6 +376,8 @@ def as_dict(self):
result['_all'] = self._all
if self._boost is not None:
result['_boost'] = self._boost
if self._routing is not None:
result['_routing'] = self._routing
if self._id is not None:
result['_id'] = self._id
if self._timestamp is not None:
Expand All @@ -381,6 +386,8 @@ def as_dict(self):
result['_index'] = self._index
if self._parent is not None:
result['_parent'] = self._parent
if self.dynamic_date_formats is not None:
result['dynamic_date_formats'] = self.dynamic_date_formats

if self.properties:
for name, value in self.properties.items():
Expand Down

0 comments on commit cb6eca2

Please sign in to comment.