⚠️ BREAKING CHANGE
Fixed Default Refresh Behavior
Previous versions (0.6.x) had a bug where all CRUD operations were implicitly using refresh="wait_for" mode, which is not the ElasticSearch default behavior.
In version 0.7.0, this bug is fixed:
- Default behavior is now
refresh=False(no refresh), matching ElasticSearch default - Changes become visible after the index's
refresh_interval(default 1 second) - This provides significantly better performance for production workloads
Migration Guide:
If your code relied on the previous behavior (implicit wait_for), you need to explicitly add the parameter:
# Before (0.6.x - implicit wait_for):
await user.save()
# After (0.7.0 - explicit if you need the old behavior):
await user.save(wait_for=True)
# or
await user.save(refresh="wait_for")For bulk operations:
# Before (0.6.x - implicit wait_for):
async with ESBulk() as bulk:
await bulk.save(user)
# After (0.7.0 - explicit if you need the old behavior):
async with ESBulk(wait_for=True) as bulk:
await bulk.save(user)Major Changes
Refresh Parameter Support
This release introduces explicit refresh parameter for CRUD operations and bulk operations, providing better control over when changes become visible to search operations.
New Features:
- Added
refreshparameter tosave()anddelete()methodsrefresh=True: Forces immediate refresh (use for testing or critical visibility needs)refresh="wait_for": Waits for next scheduled refresh (ES API compatible)
- Added
refreshparameter toESBulkcontext manager - Both
wait_for=True(Pythonic) andrefresh="wait_for"(ES API compatible) are supported refreshparameter takes priority if bothrefreshandwait_forare specified
Performance Considerations:
- Default (no parameters): Best performance, changes visible after refresh_interval
refresh=True: Can impact performance under heavy loadwait_for=Trueorrefresh="wait_for": Good balance between consistency and performance
Documentation:
- Comprehensive README updates with refresh control examples
- New test coverage for all refresh parameter scenarios
Additional Improvements
- Updated ElasticSearch test containers to latest versions (ES 8.18.8, ES 9.1.5)
- Added connection logging to ElasticSearch connect method
- Fixed host configuration in tests (localhost → 127.0.0.1)
- Updated .gitignore with macOS (.DS_Store) and MCP files
- Updated elasticsearch dependency constraint (<9.0.0 due to ping issues in 8.x)
- Code formatting improvements (JSON and INI files)