[App Search] Updated copy for Precision Slider step descriptions (#103684)

* Update precision slider description copy

* Fixed a broken (but passing) test
This commit is contained in:
Byron Hulcher 2021-06-29 13:07:33 -04:00 committed by GitHub
parent a7b5d3533e
commit 662d8a6159
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 13 deletions

View file

@ -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.',
}
);

View file

@ -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]
);
});