Comments (4)
What does the traceback look like?
from elasticutils.
It can be obtained from this kind of code:
class MyMappingType(MappingType, Indexable):
def reindex_all(cls):
tasks.index_objects.delay(cls, cls.get_model().objects.values_list('id', flat=True), id_field=cls.id_field)
Here is the full traceback:
(myapp)florent@florent:~/Work/myapp/myapp$ myapp reindex_all
Traceback (most recent call last):
File "/home/florent/.virtualenvs/myapp/bin/myapp", line 9, in <module>
load_entry_point('myapp==0.1dev', 'console_scripts', 'myapp')()
File "/home/florent/Work/myapp/myapp/myapp/manage.py", line 10, in main
execute_from_command_line(sys.argv)
File "/home/florent/.virtualenvs/myapp/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/home/florent/.virtualenvs/myapp/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/florent/.virtualenvs/myapp/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/florent/.virtualenvs/myapp/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/home/florent/Work/myapp/myapp/myapp/management/commands/reindex_all.py", line 21, in handle
m_type.run_index_all()
File "/home/florent/Work/myapp/django-esutils/django_esutils/mappings.py", line 194, in run_index_all
flat=True))
File "/home/florent/Work/myapp/django-esutils/django_esutils/mappings.py", line 189, in run_index
tasks.index_objects.delay(cls, ids, id_field=cls.id_field)
File "/home/florent/.virtualenvs/myapp/local/lib/python2.7/site-packages/celery/app/task.py", line 453, in delay
return self.apply_async(args, kwargs)
File "/home/florent/.virtualenvs/myapp/local/lib/python2.7/site-packages/celery/app/task.py", line 547, in apply_async
link=link, link_error=link_error, **options)
File "/home/florent/.virtualenvs/myapp/local/lib/python2.7/site-packages/celery/app/task.py", line 739, in apply
request=request, propagate=throw)
File "/home/florent/.virtualenvs/myapp/local/lib/python2.7/site-packages/celery/app/trace.py", line 354, in eager_trace_task
uuid, args, kwargs, request)
File "/home/florent/.virtualenvs/myapp/local/lib/python2.7/site-packages/celery/app/trace.py", line 253, in trace_task
I, R, state, retval = on_error(task_request, exc, uuid)
File "/home/florent/.virtualenvs/myapp/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/florent/Work/myapp/elasticutils/elasticutils/contrib/django/tasks.py", line 48, in index_objects
ids[0], ids[-1], len(ids)))
File "/home/florent/.virtualenvs/myapp/local/lib/python2.7/site-packages/django/db/models/query.py", line 112, in __getitem__
"Negative indexing is not supported."
AssertionError: Negative indexing is not supported.
from elasticutils.
It looks like you're passing an iterator as a task argument. I really wouldn't do this. I'd pass either a list or a tuple and not an iterator. Easy way to do this is to wrap your queryset in a list()
call.
from elasticutils.
According that, in real life, the index task is running asynchronously, it's clearly dangerous. I close.
from elasticutils.
Related Issues (20)
- support elasticsearch-py > 0.4.5 HOT 1
- The name of the primary key is hardcoded HOT 3
- bulk monkeypatch incorrectly assumes we're indexing HOT 14
- How can I query time range
- add support for wildcard query type HOT 1
- add support for wildcard indices
- elasticutils/contrib/django init uses 'six' but does not import it HOT 1
- Elasticsearch 'urls' should accept dict (now throwing TypeError: unhashable type: 'dict') HOT 1
- extract_document is missing @classmethod in django.rst HOT 2
- Don't make unindex_objects fail when trying to unindex an object that is not indexed
- Multiple search fields for query-string qury
- Filtered query
- filter_raw() overwrites filter() HOT 1
- Impossible to filter with nested objects
- small migration howto from elasticutils to elasticsearch-dsl would be nice HOT 4
- Run tests without nose
- Query with AND operator HOT 4
- Not compatible with elasticsearch>=1.8.0 HOT 2
- Wiki changes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elasticutils.