Closed jmizgajski closed 10 years ago
What version of ElasticUtils are you using?
My bad for using outdated elasticsearch-py, I was using
for elasticutils
I have miss-diagnosed the error, the problematic bit is really
index = mapping_cls.get_index()
doc_type = mapping_cls.get_mapping_type_name()
index_body = {
'settings': {
'number_of_shards': 3,
'number_of_replicas': 2
},
'mappings': {
doc_type: mapping_cls.get_mapping()
}
}
print 'Creating index : %s with request body: %s ...' % (index,
index_body)
es.indices.create(index=index, body=index_body)
where mapping_cls
is a subclass of MappingType and Indexable
Do you have Elasticsearch running on localhost:9200? What happens when you do this?:
curl http://localhost:9200/
the problem is with the 'number_of_replicas': 2 option that I added carelessly, removing it fixes the problem. Sorry for bothering you. I will soon do a little PR with some utils for automatic indexing and isolated test cases, to make it up to you.
No worries!
One thing to know is that master tip is probably going to be released as 0.9 in the next week. If you see other problems, definitely let me know.
Closing this out since it seems like it's ok now.
consider this simple bit of code used inside a
@classmethod
from a class that subclasses Indexable and MappingType, inspired by your delayed indexing task.where
batch
is a QuerySet that contains 3 objects (for now).Unfortunately with both elasticsearch 0.9 and 1.1 we get, when trying to run this code.
any ideas on what might be a reason for it?