-
Notifications
You must be signed in to change notification settings - Fork 18
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
(api): Support creating index #9
Conversation
modules/library/src/main/scala/zio/elasticsearch/ElasticRequest.scala
Outdated
Show resolved
Hide resolved
modules/library/src/main/scala/zio/elasticsearch/HttpElasticExecutor.scala
Outdated
Show resolved
Hide resolved
modules/library/src/main/scala/zio/elasticsearch/HttpElasticExecutor.scala
Outdated
Show resolved
Hide resolved
modules/library/src/main/scala/zio/elasticsearch/HttpElasticExecutor.scala
Outdated
Show resolved
Hide resolved
modules/library/src/main/scala/zio/elasticsearch/HttpElasticExecutor.scala
Outdated
Show resolved
Hide resolved
modules/library/src/main/scala/zio/elasticsearch/HttpElasticExecutor.scala
Outdated
Show resolved
Hide resolved
@@ -47,6 +47,11 @@ object ElasticRequest { | |||
): ElasticRequest[Unit] = | |||
CreateOrUpdate(index, id, Document.from(doc), routing) | |||
|
|||
def createIndex( | |||
name: IndexName, | |||
jsonBody: Option[String] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this one...
I would definitely rename it to definition
. @arnoldlacko
Also, should we use Json
or String
? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe settings/configuration?
request | ||
.put(uri"$basePath/${createIndex.name}") | ||
.contentType(ApplicationJson) | ||
.body(createIndex.jsonBody.getOrElse("")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the same behavior as creating it without body
at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
modules/library/src/main/scala/zio/elasticsearch/ElasticRequest.scala
Outdated
Show resolved
Hide resolved
63d5724
to
2a501c1
Compare
49d5b31
to
2520e00
Compare
No description provided.