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

pkg/elasticsearch: Replace hand-written models with Elasticsearch Go typed client #4

Open
marclop opened this issue Jul 5, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@marclop
Copy link
Contributor

marclop commented Jul 5, 2023

Description

Instead of using the hand-written types in

type BoolQuery struct {
Filter []any
Must []any
MustNot []any
Should []any
MinimumShouldMatch int
Boost float64
}
func (q BoolQuery) MarshalJSON() ([]byte, error) {
type boolQuery struct {
Filter []any `json:"filter,omitempty"`
Must []any `json:"must,omitempty"`
MustNot []any `json:"must_not,omitempty"`
Should []any `json:"should,omitempty"`
MinimumShouldMatch int `json:"minimum_should_match,omitempty"`
Boost float64 `json:"boost,omitempty"`
}
return encodeQueryJSON("bool", boolQuery(q))
}
. It would be better if we used the new Elasticsearch Go Typed client.

@marclop marclop added the enhancement New feature or request label Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant