Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object Http4sClient {
endpoint: ElasticNodeEndpoint
): Http4sClient[F] = {
val uri = http4s.Uri(
scheme = Some(http4s.Uri.Scheme.http),
scheme = endpoint.prefix.flatMap(http4s.Uri.Scheme.fromString(_).toOption),
authority = Some(http4s.Uri.Authority(host = http4s.Uri.RegName(endpoint.host), port = Some(endpoint.port)))
)
new Http4sClient(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ trait RequestResponseConverters extends Elastic4sEntityEncoders {
): http4s.Request[F] = {
val uri =
endpoint.copy(
path = http4s.Uri.Path(request.endpoint.stripPrefix("/").split('/').map(http4s.Uri.Path.Segment(_)).toVector),
path =
http4s.Uri.Path(request.endpoint.stripPrefix("/").split('/').map(http4s.Uri.Path.Segment.encoded).toVector),
query = http4s.Query.fromPairs(request.params.toList: _*)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ class Http4sRequestHttpClientTest extends AnyFlatSpec with Matchers with DockerT
}.unsafeRunSync().result.status shouldBe "401"
}

it should "be able index document with id properly" in {
val id = "id://test-id"
ioClient.execute {
indexInto("testindex").withId(id)
}.unsafeRunSync().result.id shouldBe id
}
}