Skip to content

Return empty results for an index that has never been written - #97

Open
daplein wants to merge 2 commits into
feature23:mainfrom
daplein:fix/search-empty-index
Open

daplein wants to merge 2 commits into
feature23:mainfrom
daplein:fix/search-empty-index

Conversation

@daplein

@daplein daplein commented Oct 16, 2026

Copy link
Copy Markdown

An index's Lucene directory is only created on the first write, so searching, counting or getting from a freshly created index returned 500 (DirectoryNotFoundException). Azure answers an empty result (404 for a missing document). The searcher now falls back to an empty reader.

ErrorResponseIntegrationTests.UnexpectedFailure_ReturnsEnvelopeWithoutInternalDetail used this 500 as its trigger (its comment anticipated the fix) and is removed; the envelope for unexpected faults is still covered by ErrorResponseTests.

Test: EmptyIndexIntegrationTests.

daplein and others added 2 commits October 16, 2026 11:23
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The envelope for unexpected faults stays covered by ErrorResponseTests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@daplein
daplein marked this pull request as ready for review October 16, 2026 10:47
@daplein

daplein commented Oct 16, 2026

Copy link
Copy Markdown
Author

This PR is independent of #94, #95 and #96 (each branches off main), so it can be merged in any order.

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