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

Unresolved reference 'Aggregation, Size, TrackTotalHits, Pretty, Sort, and Do' #1665

Open
orhan-cmd opened this issue Mar 30, 2023 · 0 comments

Comments

@orhan-cmd
Copy link

Please use the following questions as a guideline to help me answer
your issue/question without further inquiry. Thank you.

Which version of Elastic are you using?

[x] elastic.v7 (for Elasticsearch 7.x)
[ ] elastic.v6 (for Elasticsearch 6.x)
[ ] elastic.v5 (for Elasticsearch 5.x)
[ ] elastic.v3 (for Elasticsearch 2.x)
[ ] elastic.v2 (for Elasticsearch 1.x)

Please describe the expected behavior

The code should compile without errors and execute a search on the Elasticsearch client, returning a scrollable search result with the specified query, aggregation, size, track total hits, pretty, and sort options.

Please describe the actual behavior

The code is producing an error message that indicates the methods Aggregation, Size, TrackTotalHits, Pretty, Sort, and Do are not recognized. The error message suggests that there may be an issue with the syntax or reference of the Elasticsearch client methods.

Any steps to reproduce the behavior?

To reproduce this issue, try running the code provided in an IDE or text editor that supports Go, with the appropriate Elasticsearch client library imported and the required dependencies installed. Check that the method names are spelled correctly and that the appropriate functions and arguments are used. If the error persists, it may be helpful to review the Elasticsearch client documentation or seek assistance from the Elasticsearch community.

Code :

	searchResult, err := r.elasticClient.
		Scroll().
		Index(r.index).
		Query(query).
		Aggregation("agg", agg).
		Size(limit).
		TrackTotalHits(true).
		Pretty(true).
		Sort("startTime", true).
		Do(context.Background())

image

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

No branches or pull requests

1 participant