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

Suggestion: Field syntax #1400

Open
anthonycook opened this issue Oct 4, 2020 · 1 comment
Open

Suggestion: Field syntax #1400

anthonycook opened this issue Oct 4, 2020 · 1 comment
Assignees
Milestone

Comments

@anthonycook
Copy link

anthonycook commented Oct 4, 2020

Hey, I'm new to this library so forgive me If I've missed something but the syntax for querying multiple fields is:

	query := elastic.NewQueryStringQuery("example AND search")
	query = query.Field("title")
	query = query.Field("description")
	query = query.Field("tags")

I imagine this syntax could get quite large/repetitive with a large number of query fields, so could would It make sense to have something like Fields that accepts a multiple strings:

	query := elastic.NewQueryStringQuery("example AND search")
	query = query.Fields("title", "description", "tags")
@olivere
Copy link
Owner

olivere commented Oct 4, 2020

Hey. It makes sense to change the Field(field string) methods to a signature like Field(field ...string) which allows all of the above without a breaking change (in terms of recompilation at least).

@olivere olivere self-assigned this Oct 4, 2020
@olivere olivere added this to the 7.0.21 milestone Oct 4, 2020
@olivere olivere modified the milestones: 7.0.21, 7.x Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants