-
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
(dsl): Add has parent query #188
Conversation
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.
Seems good, can you just add it-tests?
def withScore(value: Boolean): HasParentQuery[S] | ||
|
||
def withScoreTrue: HasParentQuery[S] = withScore(true) | ||
|
||
def withScoreFalse: HasParentQuery[S] = withScore(false) |
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 to extract this like rest of option params? Maybe it will occur in some other query?
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 would leave it for now as I haven't found any that have this field.
score: Option[Boolean] = None | ||
) extends HasParentQuery[S] { self => | ||
|
||
override def ignoreUnmapped(value: Boolean): HasParentQuery[S] = |
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.
Remove override.
override def ignoreUnmapped(value: Boolean): HasParentQuery[S] = | ||
self.copy(ignoreUnmapped = Some(value)) | ||
|
||
override def paramsToJson(fieldPath: Option[String]): Json = |
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.
Same.
* Constructs an instance of [[zio.elasticsearch.query.HasParent]] using the specified parameters. | ||
* | ||
* @param parentType | ||
* a name of the parent relationship mapped for the join field. |
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.
* a name of the parent relationship mapped for the join field. | |
* a name of the parent relationship mapped for the join field |
* @param parentType | ||
* a name of the parent relationship mapped for the join field. | ||
* @param query | ||
* query you wish to run on parent documents of the parent_type field. |
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.
* query you wish to run on parent documents of the parent_type field. | |
* query you wish to run on parent documents of the `parent_type` field |
* Constructs an instance of [[zio.elasticsearch.query.HasParent]] using the specified parameters. | ||
* | ||
* @param parentType | ||
* a name of the parent relationship mapped for the join field. |
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.
* a name of the parent relationship mapped for the join field. | |
* a name of the parent relationship mapped for the join field |
* @param parentType | ||
* a name of the parent relationship mapped for the join field. | ||
* @param query | ||
* query you wish to run on parent documents of the parent_type field. |
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.
* query you wish to run on parent documents of the parent_type field. | |
* query you wish to run on parent documents of the `parent_type` field |
sealed trait HasParentQuery[S] extends ElasticQuery[S] with HasIgnoreUnmapped[HasParentQuery[S]] { | ||
def withScore(value: Boolean): HasParentQuery[S] | ||
|
||
def withScoreTrue: HasParentQuery[S] = withScore(true) |
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.
- Put
final def
here. - Put
withScoreFalse
thenwithScoreTrue
. - Should we put
withScore(...)
in the new line?
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.
- We did not do it so far.
Resolves
hasParentQuery
in #91Summary: