Skip to content

Consilio: keep a search within the catalog's own index - #47

Merged
unilynx merged 1 commit into
WebHare:mainfrom
RichardHoekstra:fix/consilio-search-index
Oct 13, 2026
Merged

unilynx merged 1 commit into
WebHare:mainfrom
RichardHoekstra:fix/consilio-search-index

Conversation

@RichardHoekstra

Copy link
Copy Markdown
Contributor

catalog.search() built { index: catalogIndex, ...req }. The "don't specify the index" check only rejects a truthy index, so index: undefined, null or "" passed the check and then replaced the catalog's index; the OpenSearch client turns that into /_search over every open index.

The request is now spread first so the catalog's index always wins.

Test: the end of testSuffixes in consilio.tsapi.test_ts_consilio searches with an undefined and an empty index and expects exactly the catalog's own three documents; without the fix it also returns the document from the testindex catalog.

Unrelated, noticed while reading: CatalogObj.delete() (catalog.ts ~355) fetches baseurl + "_doc/" + docid without an index name.

catalog.search() spread the caller's request over the catalog's index
({ index, ...req }). The "don't specify the index" check only rejects a truthy
index, so a request carrying index: undefined, null or "" passed the check and
then replaced the catalog's index, and the search ran over every open index on
the OpenSearch cluster.

Spread the request first so the catalog's index always wins. Test searches a
suffixed catalog with an undefined and an empty index, after another catalog
has been filled, and expects exactly its own documents.
@RichardHoekstra
RichardHoekstra requested a review from a team October 9, 2026 17:10
@unilynx
unilynx requested a review from krisbreuker October 12, 2026 08:32
@unilynx

unilynx commented Oct 12, 2026

Copy link
Copy Markdown
Member

Unrelated, noticed while reading: CatalogObj.delete() (catalog.ts ~355) fetches baseurl + "_doc/" + docid without an index name.

this is fixed by #53

@unilynx
unilynx enabled auto-merge October 12, 2026 08:33
@unilynx
unilynx merged commit e9df681 into WebHare:main Oct 13, 2026
52 of 53 checks passed
blexrob added a commit that referenced this pull request Oct 14, 2026
#53 and #47 were merged at the same time but not compatible. this PR
fixes that

This branch was successfully deployed

1 active deployment
external-ci — 228d7297 Deployed Oct 9, 2026 by RichardHoekstra via setup #22
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.

3 participants