mozilla / elasticutils

[deprecated] A friendly chainable ElasticSearch interface for python
http://elasticutils.rtfd.org
BSD 3-Clause "New" or "Revised" License
243 stars 76 forks source link

Move results metadata to es_meta object #220

Closed willkg closed 10 years ago

willkg commented 10 years ago

Django templates don't allow you to expose variables that start with an _. So having:

obj._highlight

sucked.

We've got a fair number of these metadata items and I'm concerned with each new one we add, we increase the likelihood that there's a naming conflict with actual data.

So this moves all those items into an es_meta object which you can access like this:

obj.es_meta.highlight

The one exception is _id--you can now access the id Elasticsearch gives the document with both:

obj._id

and:

obj.es_meta.id

Fixes #205

willkg commented 10 years ago

@matthieubellon, @robhudson: Can you review this? Does it look ok? Is it janky?

robhudson commented 10 years ago

r+ from me

willkg commented 10 years ago

Landed in 5b1e66c Move results metadata to es_meta object

mathieubellon commented 10 years ago

That's perfect, thanks for the update