Skip to content

Commit

Permalink
Add routing param
Browse files Browse the repository at this point in the history
  • Loading branch information
dbulaja98 committed Nov 29, 2022
1 parent 61415ec commit 64e4afd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ object ElasticRequest {

private[elasticsearch] final case class Exists(
index: IndexName,
id: DocumentId
id: DocumentId,
routing: Option[Routing] = None
) extends ElasticRequest[Boolean]

private[elasticsearch] final case class GetById(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ private[elasticsearch] final class HttpElasticExecutor private (config: ElasticC
}

private def executeExists(r: Exists): Task[Boolean] = {
val uri = uri"$basePath/${r.index}/$Doc/${r.id}"
val uri = uri"$basePath/${r.index}/$Doc/${r.id}".withParam("routing", r.routing.map(_.value))
request
.get(uri)
.head(uri)
.send(client)
.map(_.code.equals(Ok))
}
Expand Down

0 comments on commit 64e4afd

Please sign in to comment.