Skip to content

CreateIndex should return an Index instance #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eskombro opened this issue Oct 15, 2020 · 0 comments · Fixed by #39
Closed

CreateIndex should return an Index instance #38

eskombro opened this issue Oct 15, 2020 · 0 comments · Fixed by #39

Comments

@eskombro
Copy link
Member

eskombro commented Oct 15, 2020

In the current implementation, getIndex() returns an Index instance, but createIndex() returns the response of the POST request for creating an index. This forces a usage that looks like this:

...
String i = ms.createIndex(indexUid);
Index index = ms.getIndex(indexUid);
index.addDocuments(...)
...

In case createIndex succeeds, it should return an Index instance which simplifies the usage to

...
Index index = ms.createIndex(indexUid);
index.addDocuments(...)
...

In case of error, this will be handled by #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant