Skip to content

Commit

Permalink
Add descriptions for join, nested, object, percolator, rank_feature a…
Browse files Browse the repository at this point in the history
…nd rank_features.
  • Loading branch information
cjcenizal committed Jan 14, 2020
1 parent 358e87f commit d9897b3
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
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="Use this data type to enable {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

0 comments on commit d9897b3

Please sign in to comment.