From 662d8a61598956c50219eb2c850ddd87a7326fdc Mon Sep 17 00:00:00 2001 From: Byron Hulcher Date: Tue, 29 Jun 2021 13:07:33 -0400 Subject: [PATCH] [App Search] Updated copy for Precision Slider step descriptions (#103684) * Update precision slider description copy * Fixed a broken (but passing) test --- .../components/precision_slider/constants.ts | 31 ++++++++++++------- .../precision_slider.test.tsx | 8 +++-- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/constants.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/constants.ts index 194fbfa6d11a..1d6749193e29 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/constants.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/constants.ts @@ -10,42 +10,47 @@ import { i18n } from '@kbn/i18n'; const STEP_01_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.precisionSlider.step01.description', { - defaultMessage: 'Lowest precision and highest recall setting.', + defaultMessage: 'Highest recall, lowest precision setting.', } ); const STEP_02_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.precisionSlider.step02.description', { - defaultMessage: 'Default. High recall, low precision.', + defaultMessage: + 'Default: Less than half of the terms have to match. Full typo tolerance is applied.', } ); const STEP_03_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.precisionSlider.step03.description', { - defaultMessage: 'Increasing phrase matching: half the terms.', + defaultMessage: + 'Increased term requirements: To match, documents must contain all terms for queries with up to 2 terms, then half if there are more. Full typo tolerance is applied.', } ); const STEP_04_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.precisionSlider.step04.description', { - defaultMessage: 'Increasing phrase matching: three-quarters of the terms.', + defaultMessage: + 'Increased term requirements: To match, documents must contain all terms for queries with up to 3 terms, then three-quarters if there are more. Full typo tolerance is applied.', } ); const STEP_05_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.precisionSlider.step05.description', { - defaultMessage: 'Increasing phrase matching requirements: all but one of the terms.', + defaultMessage: + ' Increased term requirements: To match, documents must contain all terms for queries with up to 4 terms, then all but one if there are more. Full typo tolerance is applied.', } ); const STEP_06_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.precisionSlider.step06.description', { - defaultMessage: 'All terms must match.', + defaultMessage: + 'Increased term requirements: To match, documents must contain all terms for any query. Full typo tolerance is applied.', } ); @@ -53,35 +58,39 @@ const STEP_07_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.precisionSlider.step07.description', { defaultMessage: - 'The strictest phrase matching requirement: all terms must match, and in the same field.', + 'Strictest term requirements: To match, documents must contain all terms in the same field. Full typo tolerance is applied.', } ); const STEP_08_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.precisionSlider.step08.description', { - defaultMessage: 'Decreasing typo tolerance: advanced typo tolerance is disabled.', + defaultMessage: + 'Strictest term requirements: To match, documents must contain all terms in the same field. Partial typo tolerance is applied: fuzzy matching is disabled.', } ); const STEP_09_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.precisionSlider.step09.description', { - defaultMessage: 'Decreasing term matching: prefixing is disabled.', + defaultMessage: + 'Strictest term requirements: To match, documents must contain all terms in the same field. Partial typo tolerance is applied: fuzzy matching and prefixing are disabled.', } ); const STEP_10_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.precisionSlider.step10.description', { - defaultMessage: 'Decreasing typo-tolerance: no compound-word correction.', + defaultMessage: + 'Strictest term requirements: To match, documents must contain all terms in the same field. Partial typo tolerance is applied: in addition to the above, contractions and hyphenations are not corrected.', } ); const STEP_11_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.precisionSlider.step11.description', { - defaultMessage: 'Exact spelling matches only.', + defaultMessage: + 'Only exact matches will apply, with tolerance only for differences in capitalization.', } ); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/precision_slider.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/precision_slider.test.tsx index d7d06333517f..7b041e885dfe 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/precision_slider.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/precision_slider.test.tsx @@ -13,6 +13,7 @@ import { shallow, ShallowWrapper } from 'enzyme'; import { rerender } from '../../../../../test_helpers'; +import { STEP_DESCRIPTIONS } from './constants'; import { PrecisionSlider } from './precision_slider'; const MOCK_VALUES = { @@ -59,11 +60,14 @@ describe('PrecisionSlider', () => { describe('Step Description', () => { it('is visible when there is a step description', () => { - setMockValues({ ...MOCK_VALUES, precision: 10 }); + setMockValues({ + ...MOCK_VALUES, + searchSettings: { ...MOCK_VALUES.searchSettings, precision: 10 }, + }); rerender(wrapper); expect(wrapper.find('[data-test-subj="StepDescription"]').render().text()).toEqual( - 'Default. High recall, low precision.' + STEP_DESCRIPTIONS[10] ); });