ElasticSearch tutorial: Getting ValueError from bulk_indexing

305 Views Asked by At

I am following this tutorial.

https://medium.com/free-code-camp/elasticsearch-with-django-the-easy-way-909375bc16cb#.le6690uzj

Tutorial is about using elasticsearch with django app. I am stuck when it ask to use bulk_indexing() in shell.

I am getting this error ** raise ValueError("You cannot perform API calls on the default index.") ValueError: You cannot perform API calls on the default index.**

>>>python manage.py shell
Python 3.10.0 | packaged by conda-forge | (default, Nov 10 2021, 13:20:59) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from elasticApp.search import *
>>> bulkIndexing()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\Users\jatin.kumar.in\Documents\JK\Project\elasticApp\search.py", line 17, in bulkIndexing
ArticleIndex.init()
File "C:\Users\jatin.kumar.in\Miniconda3\envs\Project\lib\site-packages\elasticsearch_dsl\document.py", line 156, in init
i.save(using=using)
File "C:\Users\jatin.kumar.in\Miniconda3\envs\Project\lib\site-packages\elasticsearch_dsl\index.py", line 298, in save
if not self.exists(using=using):
File "C:\Users\jatin.kumar.in\Miniconda3\envs\Project\lib\site-packages\elasticsearch_dsl\index.py", line 414, in exists
return self._get_connection(using).indices.exists(index=self._name, **kwargs)
File "C:\Users\jatin.kumar.in\Miniconda3\envs\Project\lib\site-packages\elasticsearch_dsl\index.py", line 134, in _get_connection
  raise ValueError("You cannot perform API calls on the default index.")
ValueError: You cannot perform API calls on the default index.
>>>

Help me in solving this error.

0

There are 0 best solutions below