From 760f34a1ee376483dd598edf101052d25858ae98 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Wed, 1 May 2019 11:01:35 +0200 Subject: [PATCH] feat(relevance): add some synonyms (#192) This will allow obscure names like i18n an a11y show up, even if a user didn't _exactly_ type them. To be checked on a replica in advance of merging --- .../__snapshots__/config.test.js.snap | 28 +++++++++++++++++++ src/config.js | 21 ++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/src/__tests__/__snapshots__/config.test.js.snap b/src/__tests__/__snapshots__/config.test.js.snap index 105c9a84f..a18a6827d 100644 --- a/src/__tests__/__snapshots__/config.test.js.snap +++ b/src/__tests__/__snapshots__/config.test.js.snap @@ -146,6 +146,34 @@ Object { ], "type": "synonym", }, + Object { + "objectID": "a11y", + "synonyms": Array [ + "a11y", + "accessibility", + "accessible", + ], + "type": "synonym", + }, + Object { + "objectID": "i18n", + "synonyms": Array [ + "i18n", + "internationalisation", + "internationalization", + "translation", + "translate", + ], + "type": "synonym", + }, + Object { + "objectID": "k8s", + "synonyms": Array [ + "k8s", + "kubernetes", + ], + "type": "synonym", + }, ], "jsDelivrHitsEndpoint": "https://data.jsdelivr.com/v1/stats/packages/month/all", "maxObjSize": 450000, diff --git a/src/config.js b/src/config.js index 8bd89bac7..406a2945c 100644 --- a/src/config.js +++ b/src/config.js @@ -63,6 +63,27 @@ const defaultConfig = { synonyms: ['_', 'underscore'], objectID: 'underscore', }, + { + type: 'synonym', + synonyms: ['a11y', 'accessibility', 'accessible'], + objectID: 'a11y', + }, + { + type: 'synonym', + synonyms: [ + 'i18n', + 'internationalisation', + 'internationalization', + 'translation', + 'translate', + ], + objectID: 'i18n', + }, + { + type: 'synonym', + synonyms: ['k8s', 'kubernetes'], + objectID: 'k8s', + }, ], indexRules: [ {