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

Add index creation to aggregations example #1862

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

miguelgrinberg
Copy link
Collaborator

The aggregations example (composite_agg.py) assumes an index called git has been created and populated in advance, which in practice makes it impossible for most people to get the example to run.

The git index is one of the datasets used by the integration tests. In this change I have added the logic to create and populate the index, so that the example can be standalone like all the other examples.

@miguelgrinberg miguelgrinberg force-pushed the agg-example-create-index branch from c7cf87c to 0d49272 Compare July 9, 2024 17:32
@miguelgrinberg miguelgrinberg requested a review from pquentin July 9, 2024 17:36
Comment on lines 61 to 63
# just one shard, no replicas for testing
"number_of_shards": 1,
"number_of_replicas": 0,
Copy link
Member

Choose a reason for hiding this comment

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

So I know this was already here, but this seems pointless. After all examples are here to share good practices. And I would be surprised if this resulted in significant savings.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I agree, I'll remove it.

@miguelgrinberg miguelgrinberg force-pushed the agg-example-create-index branch from e3914bb to 9dda757 Compare July 10, 2024 08:56
@miguelgrinberg miguelgrinberg added the backport 8.x Backport to 8.x label Jul 10, 2024
@miguelgrinberg miguelgrinberg merged commit 8a110b0 into elastic:main Jul 10, 2024
17 checks passed
@miguelgrinberg miguelgrinberg deleted the agg-example-create-index branch July 10, 2024 10:05
github-actions bot pushed a commit that referenced this pull request Jul 10, 2024
* Add index creation to aggregations example

* remove shard/replica restrictions from test datasets

(cherry picked from commit 8a110b0)
miguelgrinberg added a commit that referenced this pull request Jul 10, 2024
* Add index creation to aggregations example

* remove shard/replica restrictions from test datasets

(cherry picked from commit 8a110b0)

Co-authored-by: Miguel Grinberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 8.x Backport to 8.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants