Apply recommended index settings: add attribute ranking rule to products index #3

Closed
opened 2026-08-26 22:25:46 +00:00 by david · 0 comments
Owner

Summary

Apply the index-side fix recommended in docs/research-brief-meilisearch-search-relevance.md to the Shoppy Meilisearch products index.

The brief diagnosed why singular queries (banana, apple) fail to surface actual produce while plurals (bananas, apples) work. Primary root cause: the attribute ranking rule is missing from the index settings, so once words/typo/proximity tie for a single-word query, the sort rule (price asc, the BFF default) decides everything — the cheapest product mentioning "banana" (e.g. a $0.80 yoghurt pouch) beats actual bananas.

- "rankingRules": ["words", "typo", "proximity", "sort", "exactness"]
+ "rankingRules": ["words", "typo", "proximity", "attribute", "sort", "exactness"]
  • Do not move exactness before sort (penalises plural-named produce; tested worse).
  • Do not add bananabananas synonyms (no measurable benefit given prefixSearch: "indexingTime").

Scope

  1. shoppy-products.json in this repo — ranking rules updated (done).
  2. Sync the change to the live template shoppy-indexes/shoppy-test.json (consumed by product-sync via MEILISEARCH_INDEX_CONFIG_PRODUCTS).
  3. Optionally mirror in shoppy-categories.json for consistency.
  4. Trigger the next fresh index run (e.g. shoppy-test-v10) — settings apply automatically at index creation; no data changes needed.

Validation

Per section 6 of the brief, with the app default sort + store header:

  • banana/coles → Bananas #1 (was pouch #1).
  • banana/woolworths → 2 of top 3 are produce.
  • apple/woolworths+coles → actual apples in top 3.
  • Regression: plural queries (bananas, apples), category browse, specials, facet filtering.
  • Spot-check _rankingScoreDetails to confirm attribute appears at order 3 and sort only breaks ties.

Notes / blockers

  • The LM Studio embedding server (10.1.5.170:1234) is down — the next fresh index run will fail to embed unless restored (unrelated to this change, but blocks re-embedding).
  • Kong gateway blocks PUT /indexes/{uid}/settings and several sub-routes; use the allowed sub-routes (ranking-rules, etc.) if scripting the change directly.
## Summary Apply the index-side fix recommended in [`docs/research-brief-meilisearch-search-relevance.md`](./docs/research-brief-meilisearch-search-relevance.md) to the Shoppy Meilisearch products index. The brief diagnosed why singular queries (`banana`, `apple`) fail to surface actual produce while plurals (`bananas`, `apples`) work. Primary root cause: the `attribute` ranking rule is missing from the index settings, so once `words`/`typo`/`proximity` tie for a single-word query, the `sort` rule (price asc, the BFF default) decides everything — the cheapest product mentioning "banana" (e.g. a $0.80 yoghurt pouch) beats actual bananas. ## Recommended change ```diff - "rankingRules": ["words", "typo", "proximity", "sort", "exactness"] + "rankingRules": ["words", "typo", "proximity", "attribute", "sort", "exactness"] ``` - **Do not** move `exactness` before `sort` (penalises plural-named produce; tested worse). - **Do not** add `banana`↔`bananas` synonyms (no measurable benefit given `prefixSearch: "indexingTime"`). ## Scope 1. `shoppy-products.json` in this repo — ranking rules updated (done). 2. Sync the change to the live template `shoppy-indexes/shoppy-test.json` (consumed by `product-sync` via `MEILISEARCH_INDEX_CONFIG_PRODUCTS`). 3. Optionally mirror in `shoppy-categories.json` for consistency. 4. Trigger the next fresh index run (e.g. `shoppy-test-v10`) — settings apply automatically at index creation; no data changes needed. ## Validation Per section 6 of the brief, with the app default sort + store header: - `banana`/coles → `Bananas` #1 (was pouch #1). - `banana`/woolworths → 2 of top 3 are produce. - `apple`/woolworths+coles → actual apples in top 3. - Regression: plural queries (`bananas`, `apples`), category browse, specials, facet filtering. - Spot-check `_rankingScoreDetails` to confirm `attribute` appears at order 3 and `sort` only breaks ties. ## Notes / blockers - The LM Studio embedding server (`10.1.5.170:1234`) is down — the next fresh index run will fail to embed unless restored (unrelated to this change, but blocks re-embedding). - Kong gateway blocks `PUT /indexes/{uid}/settings` and several sub-routes; use the allowed sub-routes (`ranking-rules`, etc.) if scripting the change directly.
david closed this issue 2026-08-27 22:27:05 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
shoppy/shoppy-index-configuration#3
No description provided.