Skip to content
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

Allow ElasticPrimitive types in term and terms query #282

Merged
merged 3 commits into from
Jul 7, 2023

Conversation

drmarjanovic
Copy link
Member

No description provided.

* @tparam S
* document for which field query is executed
* @return
* an instance of [[zio.elasticsearch.query.TermQuery]] that represents the term query to be performed.
*/
final def term[S](field: Field[S, String], value: String): TermQuery[S] =
final def term[S, A: ElasticPrimitive](field: Field[S, A], value: A): TermQuery[S] =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about leaving just _ instead of giving strict A: ElasticPrimitive?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use the same approach for matches query.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, we are limiting possible types for values. I wouldn't say we should allow passing an object as the argument.

@drmarjanovic drmarjanovic force-pushed the fix-term-terms-query-allowed-type branch from 29034c6 to e3e1431 Compare July 7, 2023 09:43
@mvelimir mvelimir merged commit 4357fa2 into main Jul 7, 2023
@mvelimir mvelimir deleted the fix-term-terms-query-allowed-type branch July 7, 2023 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants