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

Return More Specific Mapping Types from Search Requests #256

Open davidlundgren opened 9 years ago

davidlundgren commented 9 years ago

Return more specific MappingTypes than the elasticutils.DefaultMappingType when searching across multiple types.

For example, one might want to do something like:

class MyMappingType(MappingType, Indexable):
  def foo(self):
    # logic ...

q = S().indexes('thisindex', 'thatindex')
for hit in q[:10]:
  print hit.foo()
krs-wraus commented 9 years ago

Going to agree that this is something that would be very helpful. Currently there's no way to get more specific mapping types when searching across multiple indexes or doctypes, which can cause a lot of frustration when there's any kind of custom code in the mapping type itself.