openvibers/openvibe.shoes Commits

The Search body leaves out the title and summary it repeated (#41)

OP OpenVibers committed 11 days ago · 9134117ea0 · 1 file, +2 −1

Search's snippet reads the summary and body together; the body restated the title and summary, so
results repeated themselves. It keeps what neither says.

Changes

ddiff --git a/server/search-index.js b/server/search-index.js
iindex 1f1f2c5..dcfd65f 100644
---- a/server/search-index.js
++++ b/server/search-index.js
@@@ -33,7 +33,8 @@ function describe(row) {
noindex: !stores,
title: row.name,
summary: `${row.name} by ${row.brand}. ${price} Every store's price, the price history and the size curve on open.shoes.`,
-- body: [row.name, row.brand, row.model, price].filter(Boolean).join('\n'),
++ // The snippet reads the summary and body together: the body is the model name only when it differs from the title.
++ body: row.model && row.model !== row.name ? row.model : '',
facets: { brand: row.brand, stores, ...(row.price_min != null ? { lowest_price: Math.round(Number(row.price_min)) } : {}) },
authorship: { mode: 'imported' },
publishedAt: iso(row.first_seen_at),