Home > Blockchain >  Why index is not creating in elasticsearch 8.3.2 automatically
Why index is not creating in elasticsearch 8.3.2 automatically

Time:10-14

  • i m using Python api to insert and fetch from elasticsearch, verseion is 8.3.2

  • data = [ { 'id': 1, 'Title': 'Live1'},{ 'id': 2, 'Title': 'Live2'},{ 'id': 3, 'Title': 'Live3'}]

  • when try inserting I got Not Found error, It was working in version 7

from elasticsearch import Elasticsearch
client = Elasticsearch("http://user:password@localhost:9200")

for e in data:
    client.index(index="movie_data", document=e, id=e['id'])

Error > NotFoundError: NotFoundError(404, 'index_not_found_exception', "no such index [movie_data] and [action.auto_create_index] ([.monitoring*,.watches,.triggered_watches,.watcher-history*,.ml*]) doesn't match")

In my yaml file i have added this action.auto_create_index: .monitoring*,.watches,.triggered_watches,.watcher-history*,.ml*

  • My related question is when i tried client.indices.get_mapping( 'movie_data' )

I got error > TypeError: Positional arguments can't be used with Elasticsearch API methods. Instead only use keyword arguments.

CodePudding user response:

In your action.auto_create_index list you don't have movie_data so the index cannot be auto-created.

You can either add it or remove that line completely.

  • Related