0
  • 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.

2
  • you can access kibana dev tools and execute command GET _cat/indices? Commented Oct 13, 2022 at 11:20
  • @rabbitbr dont have kibana, using python for querying Commented Oct 13, 2022 at 11:58

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

can you let me know what is action.auto_create_index: .monitoring*,.watches,.triggered_watches,.watcher-history*,.ml* will do, as from blog while installing it is suggested like that, Any doc i could refer for this also will help
If you list index name patterns in that setting, it will only allow those indexes to be created automatically by ES if they don't exist. Since movie_data is not listed, it's not getting created when you index the first document. You can, however, create it manually and then run your indexing code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.