Skip to content

Commit

Permalink
[App Search] Updated copy for Precision Slider step descriptions (#10…
Browse files Browse the repository at this point in the history
…3684)

* Update precision slider description copy

* Fixed a broken (but passing) test
  • Loading branch information
byronhulcher authored Jun 29, 2021
1 parent a7b5d35 commit 662d8a6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,78 +10,87 @@ 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.',
}
);

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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]
);
});

Expand Down

0 comments on commit 662d8a6

Please sign in to comment.