Closed shacker closed 7 months ago
Hey @shacker, I followed the steps you mentioned, but everything seems to be working fine. Did I miss anything? Thanks!
index = 'abc1234' client.create(index=index, id=1, body={'title': 'Beauty and the Beast', 'year': 1991})
{'_index': 'abc1234',
'_id': '1',
'_version': 1,
'result': 'created',
'_shards': {'total': 2, 'successful': 1, 'failed': 0},
'_seq_no': 0,
'_primary_term': 1}
client.indices.put_alias(index=index, name = 'foo')
{'acknowledged': True}
client.get(index=index,id=1)
{'_index': 'abc1234',
'_id': '1',
'_version': 1,
'_seq_no': 0,
'_primary_term': 1,
'found': True,
'_source': {'title': 'Beauty and the Beast', 'year': 1991}}
This will also work. Guides can be found here :)
index = 'abc12345' client.indices.create(index=index)
client.indices.put_alias(index=index, name = 'foo')
client.create(index=index, id=1, body={'title': 'Beauty and the Beast', 'year': 1991})
client.get(index=index,id=1)
@saimedhi Well, I am embarrassed. I tried to test and document this issue so carefully, but now I cannot reproduce it, and client.get() is working just fine. I don't know what is different between now and this morning, but you're right, it's just fine. My apologies for taking your time. All good!
Also thanks for the link to the guides, very useful.
@saimedhi Well, I am embarrassed. I tried to test and document this issue so carefully, but now I cannot reproduce it, and client.get() is working just fine. I don't know what is different between now and this morning, but you're right, it's just fine. My apologies for taking your time. All good!
Also thanks for the link to the guides, very useful.
No worries, happy to hear the guides were useful! Thank you:)
@shacker if you want to help with something, go through the user guides and add some things about aliases if we don't already have it!
What is the bug?
Given a known index name and document ID, this call should work:
index_name is aliased to foo, but that shouldn't matter - I'm talking to the index directly and not interested in the alias. I get this error:
Notice that the GET was issued to the alias name, not to the index name, so no wonder I'm getting that error. The GET call should have been issued to
GET http://localhost:9200/abc123/_doc/7mt5jYsBNvxwk6rSf2uq
How can one reproduce the bug?
client.get(index=index_name, id=doc_id)
What is the expected behavior?
The call is issued to a URL that includes the index name, not that index's alias
What is your host/environment?
Mac OS 14.1.1 opensearch-py 2.4.2
Do you have any screenshots?
n/a
Do you have any additional context?
n/a