-
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
Create public methods for script and inner hits #216
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,10 +22,10 @@ import zio.elasticsearch.script.options._ | |
import zio.json.ast.Json | ||
import zio.json.ast.Json.Obj | ||
|
||
private[elasticsearch] final case class Script( | ||
source: String, | ||
params: Map[String, Any], | ||
lang: Option[String] | ||
final case class Script private[elasticsearch] ( | ||
private val source: String, | ||
private val params: Map[String, Any], | ||
private val lang: Option[String] | ||
) extends HasLang[Script] | ||
with HasParams[Script] { self => | ||
def lang(value: String): Script = | ||
|
@@ -57,6 +57,6 @@ private[elasticsearch] final case class Script( | |
} | ||
|
||
object Script { | ||
def apply(source: String): Script = | ||
def from(source: String): Script = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We agreed earlier that overriding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would consider There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. I will change it to |
||
Script(source = source, params = Map.empty, lang = None) | ||
} |
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.
Why is this changed? Not sorted.
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.
It does not make sense to me when creating new InnerHits to say just
InnerHits.name(...)
,withName
made more sense. I would consider doing same forform
andsize
. What do you think?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.
I think we are trying to avoid
with
prefix. @arnoldlacko?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.
Maybe we could drop all these and just have
InnerHits.empty.name(...).from(...)
?