Skip to content

calling refresh_index before query#217

Merged
hnwyllmm merged 1 commit into
oceanbase:developfrom
hnwyllmm:doc
May 12, 2026
Merged

calling refresh_index before query#217
hnwyllmm merged 1 commit into
oceanbase:developfrom
hnwyllmm:doc

Conversation

@hnwyllmm

@hnwyllmm hnwyllmm commented May 12, 2026

Copy link
Copy Markdown
Member

Summary

calling refresh_index before query.
Fix the examples which doesn't calling refresh_index() interface.

Summary by CodeRabbit

  • Documentation
    • Updated README Quick Start guide and example scripts to include index refresh after document insertion
    • Ensures consistent demonstration of search workflows across all documentation

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4e331b28-b85c-4202-806e-5c547243a856

📥 Commits

Reviewing files that changed from the base of the PR and between 50cdd99 and 5402655.

📒 Files selected for processing (5)
  • README.md
  • examples/complete_example.py
  • examples/hybrid_search_example.py
  • examples/simple_example.py
  • examples/sparse_vector_index_example.py

📝 Walkthrough

Walkthrough

Examples and documentation now consistently demonstrate calling collection.refresh_index() after adding documents to ensure newly inserted records are searchable before querying. The pattern is applied uniformly across the Quick Start documentation and all example scripts.

Changes

Index Refresh Pattern Documentation and Examples

Layer / File(s) Summary
Quick Start documentation update
README.md
README Quick Start code snippet now includes collection.refresh_index() call after adding documents and before running the query example.
Basic example scripts with refresh pattern
examples/simple_example.py, examples/complete_example.py, examples/hybrid_search_example.py
Simple, complete, and hybrid search example files all add collection.refresh_index() calls after inserting sample data and before executing search queries.
Advanced sparse vector example with multiple refresh calls
examples/sparse_vector_index_example.py
Sparse vector index example adds collection.refresh_index() calls in two locations: after sparse demo documents are added, and after hybrid demo documents are added, before their respective query operations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Fresh indices make documents dance,
Add, refresh, then give queries a chance,
From README to sparse vectors wide,
The examples now show the right guide! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change across all files: adding refresh_index() calls before query operations in documentation and examples.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hnwyllmm hnwyllmm merged commit e1ed87d into oceanbase:develop May 12, 2026
9 checks passed
@hnwyllmm hnwyllmm deleted the doc branch May 12, 2026 07:17
hnwyllmm added a commit that referenced this pull request May 21, 2026
…#222)

## Summary

- Remove the early return in `_transform_sql_result` for empty
`result_rows`, so empty hybrid/search results respect the `include`
parameter instead of always returning all columns.
- Add unit tests covering empty-result shape for `include=None`,
`include=[]`, and `include=["embeddings"]`.
- Call `collection.refresh_index()` before hybrid search in the
integration test so index state is ready after recent
`refresh_index`-before-query behavior (#217).

## Test plan

- [x] `uv run pytest
tests/unit_tests/test_hybrid_search_source_inference.py`
- [ ] `uv run pytest
tests/integration_tests/test_collection_hybrid_search_source_inference.py`
(requires real DB)


Made with [Cursor](https://cursor.com)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Fixed handling of empty search results to return consistent column
structures based on the requested data types.

* **Tests**
* Added test coverage for empty result scenarios to verify correct
column structure across various configuration options.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/oceanbase/pyseekdb/pull/222?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Cursor <cursoragent@cursor.com>
JingYuChe pushed a commit to JingYuChe/pyseekdb that referenced this pull request Jun 22, 2026
<!--
Thank you for contributing to OceanBase! 
Please feel free to ping the maintainers for the review!
-->

## Summary
<!-- 
Please clearly and concisely describe the purpose of this pull request.
If this pull request resolves an issue, please link it via "close #xxx"
or "fix #xxx".
-->
calling refresh_index before query.
Fix the examples which doesn't calling refresh_index() interface.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Updated README Quick Start guide and example scripts to include index
refresh after document insertion
* Ensures consistent demonstration of search workflows across all
documentation

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/oceanbase/pyseekdb/pull/217)

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
JingYuChe pushed a commit to JingYuChe/pyseekdb that referenced this pull request Jun 22, 2026
…oceanbase#222)

## Summary

- Remove the early return in `_transform_sql_result` for empty
`result_rows`, so empty hybrid/search results respect the `include`
parameter instead of always returning all columns.
- Add unit tests covering empty-result shape for `include=None`,
`include=[]`, and `include=["embeddings"]`.
- Call `collection.refresh_index()` before hybrid search in the
integration test so index state is ready after recent
`refresh_index`-before-query behavior (oceanbase#217).

## Test plan

- [x] `uv run pytest
tests/unit_tests/test_hybrid_search_source_inference.py`
- [ ] `uv run pytest
tests/integration_tests/test_collection_hybrid_search_source_inference.py`
(requires real DB)


Made with [Cursor](https://cursor.com)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Fixed handling of empty search results to return consistent column
structures based on the requested data types.

* **Tests**
* Added test coverage for empty result scenarios to verify correct
column structure across various configuration options.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/oceanbase/pyseekdb/pull/222?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Cursor <cursoragent@cursor.com>
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

Successfully merging this pull request may close these issues.

1 participant