Skip to content

Commit

Permalink
Fix toJson method
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasilije Milic committed Aug 16, 2023
1 parent 8b50de1 commit 50462fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ private[elasticsearch] final case class MatchPhrasePrefix[S](field: String, valu
extends MatchPhrasePrefixQuery[S] {

private[elasticsearch] def toJson(fieldPath: Option[String]): Json =
Obj("match_phrase_prefix" -> Obj(fieldPath.foldRight(field)(_ + "." + _) -> value.toJson))
Obj("match_phrase_prefix" -> Obj(fieldPath.foldRight(field)(_ + "." + _) -> Obj("query" -> value.toJson)))
}

sealed trait NestedQuery[S]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2485,7 +2485,9 @@ object ElasticQuerySpec extends ZIOSpecDefault {
"""
|{
| "match_phrase_prefix": {
| "stringField": "test"
| "stringField": {
| "query" : "test"
| }
| }
|}
|""".stripMargin
Expand Down

0 comments on commit 50462fc

Please sign in to comment.