Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mappings editor] Add descriptions for join, nested, object, percolator, rank_feature and rank_features. #54841

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -257,6 +257,26 @@ export const TYPE_DEFINITION: { [key in DataType]: DataTypeDefinition } = {
documentation: {
main: '/object.html',
},
description: () => (
<p>
<FormattedMessage
id="xpack.idxMgmt.mappingsEditor.dataType.objectLongDescription"
defaultMessage="Object fields can contain children. To allow child objects to be queried independently of one another, use the {nested}."
values={{
nested: (
<EuiLink href={documentationService.getTypeDocLink('nested')} target="_blank">
{i18n.translate(
'xpack.idxMgmt.mappingsEditor.dataType.objectLongDescription.nestedTypeLink',
{
defaultMessage: 'nested data type',
}
)}
</EuiLink>
),
}}
/>
</p>
),
},
nested: {
label: i18n.translate('xpack.idxMgmt.mappingsEditor.dataType.nestedDescription', {
Expand All @@ -266,6 +286,26 @@ export const TYPE_DEFINITION: { [key in DataType]: DataTypeDefinition } = {
documentation: {
main: '/nested.html',
},
description: () => (
<p>
<FormattedMessage
id="xpack.idxMgmt.mappingsEditor.dataType.nestedLongDescription"
defaultMessage="Like {objects}, nested fields can contain children. The difference is that their child objects can be queried independently of one another."
values={{
objects: (
<EuiLink href={documentationService.getTypeDocLink('object')} target="_blank">
{i18n.translate(
'xpack.idxMgmt.mappingsEditor.dataType.nestedLongDescription.objectTypeLink',
{
defaultMessage: 'objects',
}
)}
</EuiLink>
),
}}
/>
</p>
),
},
rank_feature: {
label: i18n.translate('xpack.idxMgmt.mappingsEditor.dataType.rankFeatureDescription', {
Expand All @@ -275,6 +315,26 @@ export const TYPE_DEFINITION: { [key in DataType]: DataTypeDefinition } = {
documentation: {
main: '/rank-feature.html',
},
description: () => (
<p>
<FormattedMessage
id="xpack.idxMgmt.mappingsEditor.dataType.rankFeatureLongDescription"
defaultMessage="Ranke feature fields accept numbers that will boost documents in {rankFeatureQuery}."
values={{
rankFeatureQuery: (
<EuiLink href={documentationService.getRankFeatureQueryLink()} target="_blank">
{i18n.translate(
'xpack.idxMgmt.mappingsEditor.dataType.rankFeatureLongDescription.queryLink',
{
defaultMessage: 'rank_feature queries',
}
)}
</EuiLink>
),
}}
/>
</p>
),
},
rank_features: {
label: i18n.translate('xpack.idxMgmt.mappingsEditor.dataType.rankFeaturesDescription', {
Expand All @@ -284,6 +344,26 @@ export const TYPE_DEFINITION: { [key in DataType]: DataTypeDefinition } = {
documentation: {
main: '/rank-features.html',
},
description: () => (
<p>
<FormattedMessage
id="xpack.idxMgmt.mappingsEditor.dataType.rankFeaturesLongDescription"
defaultMessage="Ranke features fields accept numeric feature vectors that will boost documents in {rankFeatureQuery}."
values={{
rankFeatureQuery: (
<EuiLink href={documentationService.getRankFeatureQueryLink()} target="_blank">
{i18n.translate(
'xpack.idxMgmt.mappingsEditor.dataType.rankFeaturesLongDescription.queryLink',
{
defaultMessage: 'rank_feature queries',
}
)}
</EuiLink>
),
}}
/>
</p>
),
},
dense_vector: {
label: i18n.translate('xpack.idxMgmt.mappingsEditor.dataType.denseVectorDescription', {
Expand Down Expand Up @@ -454,6 +534,26 @@ export const TYPE_DEFINITION: { [key in DataType]: DataTypeDefinition } = {
documentation: {
main: '/percolator.html',
},
description: () => (
<p>
<FormattedMessage
id="xpack.idxMgmt.mappingsEditor.dataType.percolatorLongDescription"
defaultMessage="The percolator data type enables {percolator}."
values={{
percolator: (
<EuiLink href={documentationService.getPercolatorQueryLink()} target="_blank">
{i18n.translate(
'xpack.idxMgmt.mappingsEditor.dataType.percolatorLongDescription.learnMoreLink',
{
defaultMessage: 'percolator queries',
}
)}
</EuiLink>
),
}}
/>
</p>
),
},
join: {
label: i18n.translate('xpack.idxMgmt.mappingsEditor.dataType.joinDescription', {
Expand All @@ -463,6 +563,14 @@ export const TYPE_DEFINITION: { [key in DataType]: DataTypeDefinition } = {
documentation: {
main: '/parent-join.html',
},
description: () => (
<p>
<FormattedMessage
id="xpack.idxMgmt.mappingsEditor.dataType.joinLongDescription"
defaultMessage="Join fields define parent-child relationships among documents of the same index."
/>
</p>
),
},
alias: {
label: i18n.translate('xpack.idxMgmt.mappingsEditor.dataType.aliasDescription', {
Expand Down
Expand Up @@ -57,6 +57,14 @@ class DocumentationService {
return `${this.esDocsBase}/dynamic-field-mapping.html`;
}

public getPercolatorQueryLink() {
return `${this.esDocsBase}/query-dsl-percolate-query.html`;
}

public getRankFeatureQueryLink() {
return `${this.esDocsBase}/rank-feature.html`;
}

public getMetaFieldLink() {
return `${this.esDocsBase}/mapping-meta-field.html`;
}
Expand Down