Closed jmizgajski closed 10 years ago
A problem seems to be with the self._clone()
method of S
when debuging
def __getitem__(self, k):
"""Handles slice and indexes for Elasticsearch results"""
new = self._clone()
if isinstance(k, slice):
new.start, new.stop = k.start or 0, k.stop
return new
else:
new.start, new.stop = k, k + 1
return list(new)[0]
list(self)
returns 1 element
when list(new)
with is empty
btw, we are running elasticsearch 1.1, but did not have any problems without our custom modifications.
We figured it out, our es got broken by https://github.com/elasticsearch/elasticsearch-lang-python/tree/es-1.1. Nonetheless please chekout the gist and tell me what you think. I was hoping for some directions about where to put it in elasticutils when I'll do a pull request.
Sticking this in the ElasticUtils 0.10 milestone.
That's awesome, maybe we could arrange a hangout so you could instruct me how to structure it for a PR, by the way we updated it a bit in the meantime and it works great. You can reach me at mizgajski dottt jan attt gmail.
Is this fixed now? I thought it was still an issue.
I'm not experiencing this issue anymore, but I uninstalled the culprit plugin
Hi there,
We created a custom type based on
Indexable
andMappingType
that registers all subclasses in a meta class so that they can be used in commands that do very fast batch indexing and tests that set up all indices (properly prefixed) for you (soon I'll do a pull request). However I have run in to a very unusual problem where I cannot get the first result of aquery
in a regular way whenlist(query)[0]
works fine, the query is in simple form of:S(UserMapping).filter(id=some_id)
.Here is a gist of the few files that we wrote,
BatchIndexable
is a class we use as a parent for all our mappings.