openvibers/openvibe.search Commits

Search: the hosting catalog is an index owner (host) (#45)

OP OpenVibers committed 12 Oct 2026 · f839c9d621 · 2 files, +5 −4

Search accepts `host` as an index-event owner: the hosting catalog's plan and provider pages arrive as `host.index_document.upserted|deleted` (Contracts 0.145.0; the Host PR follows), like Work's listings and Help's articles.

Test: `webhook-inbox.test.js` indexes a Host plan beside the other record products. The 21 covering test files pass.

Changes

ddiff --git a/server/config.js b/server/config.js
iindex c787387..a7b10bd 100644
---- a/server/config.js
++++ b/server/config.js
@@@ -45,8 +45,8 @@ function parseZones(v) {
const DEFAULT_EVENT_OWNERS = ['wiki', 'blog', 'news', 'reviews', 'deals', 'coupons', 'trade',
'community', 'live', 'media', 'codes', 'games', 'tools', 'sources',
// Record products (openvibe-publishing/search-feed, contracts 0.128.0): job listings, rental listings, help
-- // articles, item definitions and quests.
-- 'work', 'rent', 'help', 'inventory', 'quest'];
++ // articles, item definitions and quests; the hosting catalog's plans and providers (contracts 0.145.0).
++ 'work', 'rent', 'help', 'inventory', 'quest', 'host'];
function load(env = process.env) {
const nodeEnv = env.NODE_ENV || 'development';
ddiff --git a/test/webhook-inbox.test.js b/test/webhook-inbox.test.js
iindex 0a23b49..e74cfbf 100644
---- a/test/webhook-inbox.test.js
++++ b/test/webhook-inbox.test.js
@@@ -120,16 +120,17 @@ t('unknown owners, subject mismatches and invalid documents are refused', async
assert.strictEqual((await search('sigmaword')).length, 0);
});
--t('the record products are accepted owners: a Work job, a Rent listing, a Help article, an Inventory definition and a Quest', async () => {
++t('the record products are accepted owners: a Work job, a Rent listing, a Help article, an Inventory definition, a Quest and a Host catalog plan', async () => {
const docs = [
doc({ owner: 'work', type: 'job', id: 'job_0123456789abcdefghjkmnpqrs', canonical_url: 'https://openvibe.work/jobs/job_0123456789abcdefghjkmnpqrs', title: 'Backend engineer recordsword', authorship: 'imported' }),
doc({ owner: 'rent', type: 'listing', id: 'rnt_01JAB2C3D4E5F6G7H8J9K0MNPQ', canonical_url: 'https://openvibe.rent/listings/rnt_01JAB2C3D4E5F6G7H8J9K0MNPQ', title: 'Room near the park recordsword' }),
doc({ owner: 'help', type: 'article', id: 'openvibe.live:how-do-i-go-live', canonical_url: 'https://openvibe.help/a/openvibe.live/how-do-i-go-live', title: 'How do I go live recordsword' }),
doc({ owner: 'inventory', type: 'definition', id: 'itd_01JAB2C3D4E5F6G7H8J9K0MNPQ', canonical_url: 'https://openvibe.inventory/definitions/itd_01JAB2C3D4E5F6G7H8J9K0MNPQ', title: 'Fire Name recordsword' }),
doc({ owner: 'quest', type: 'quest', id: 'go-live', canonical_url: 'https://openvibe.quest/quests/go-live', title: 'Go live once recordsword' }),
++ doc({ owner: 'host', type: 'plan', id: 'hpl_01M4PJ8C3ZNPWVVZM9N5XXH45J', canonical_url: 'https://openvibe.host/catalog/plans/hpl_01M4PJ8C3ZNPWVVZM9N5XXH45J', title: 'Linode Nanode 1GB recordsword', authorship: 'imported' }),
];
for (const d of docs) assert.strictEqual((await deliver(svc.base, indexEvent(d))).body.outcome, 'applied', d.owner);
-- assert.deepStrictEqual((await search('recordsword')).map((r) => r.owner).sort(), ['help', 'inventory', 'quest', 'rent', 'work']);
++ assert.deepStrictEqual((await search('recordsword')).map((r) => r.owner).sort(), ['help', 'host', 'inventory', 'quest', 'rent', 'work']);
});
t('events that are not index documents are acknowledged and ignored', async () => {