Skip to content

Commit

Permalink
[ML] Transforms: Remove index field limitation for custom query. (#81467
Browse files Browse the repository at this point in the history
) (#81755)

The query bar originally developed for the transforms wizard didn't work with indices with more than 1024 fields. In that case we disabled the query bar and showed an info-callout. Since we moved on to make use of the KQL query bar, this limitation does no longer exist so this PR removes the limitation.
  • Loading branch information
walterra authored Oct 27, 2020
1 parent 786ddfb commit 25e102a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@ export const StepDefineForm: FC<StepDefineFormProps> = React.memo((props) => {
toastNotifications,
};

// TODO This should use the actual value of `indices.query.bool.max_clause_count`
const maxIndexFields = 1024;
const numIndexFields = indexPattern.fields.length;
const disabledQuery = numIndexFields > maxIndexFields;

const copyToClipboardSource = getIndexDevConsoleStatement(pivotQuery, indexPattern.title);
const copyToClipboardSourceDescription = i18n.translate(
'xpack.transform.indexPreview.copyClipboardTooltip',
Expand Down Expand Up @@ -181,18 +176,6 @@ export const StepDefineForm: FC<StepDefineFormProps> = React.memo((props) => {
label={i18n.translate('xpack.transform.stepDefineForm.indexPatternLabel', {
defaultMessage: 'Index pattern',
})}
helpText={
disabledQuery
? i18n.translate('xpack.transform.stepDefineForm.indexPatternHelpText', {
defaultMessage:
'An optional query for this index pattern is not supported. The number of supported index fields is {maxIndexFields} whereas this index has {numIndexFields} fields.',
values: {
maxIndexFields,
numIndexFields,
},
})
: ''
}
>
<span>{indexPattern.title}</span>
</EuiFormRow>
Expand All @@ -214,7 +197,7 @@ export const StepDefineForm: FC<StepDefineFormProps> = React.memo((props) => {
{/* Flex Column #1: Search Bar / Advanced Search Editor */}
{searchItems.savedSearch === undefined && (
<>
{!disabledQuery && !isAdvancedSourceEditorEnabled && (
{!isAdvancedSourceEditorEnabled && (
<SourceSearchBar
indexPattern={indexPattern}
searchBar={stepDefineForm.searchBar}
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -19774,7 +19774,6 @@
"xpack.transform.stepDefineForm.groupByExistsErrorMessage": "「{aggName}」という名前のグループ分け構成は既に存在します。",
"xpack.transform.stepDefineForm.groupByLabel": "グループ分けの条件",
"xpack.transform.stepDefineForm.groupByPlaceholder": "グループ分けの条件フィールドを追加…",
"xpack.transform.stepDefineForm.indexPatternHelpText": "このインデックスパターンのオプションのクエリはサポートされていません。サポートされているインデックスフィールドの数は {maxIndexFields} で、このインデックスには {numIndexFields} 個のフィールドがあります。",
"xpack.transform.stepDefineForm.indexPatternLabel": "インデックスパターン",
"xpack.transform.stepDefineForm.invalidKuerySyntaxErrorMessageQueryBar": "無効なクエリ:{errorMessage}",
"xpack.transform.stepDefineForm.maxSubAggsLevelsLimitMessage": "フォームで追加できる下位集約の最大レベル数に達しました。別のレベルを追加する場合は、JSON構成を編集してください。",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -19793,7 +19793,6 @@
"xpack.transform.stepDefineForm.groupByExistsErrorMessage": "名称为“{aggName}”的分组依据配置已存在。",
"xpack.transform.stepDefineForm.groupByLabel": "分组依据",
"xpack.transform.stepDefineForm.groupByPlaceholder": "添加分组依据字段……",
"xpack.transform.stepDefineForm.indexPatternHelpText": "不支持此索引模式的可选查询。受支持索引字段数目为 {maxIndexFields},而此索引有 {numIndexFields} 个字段。",
"xpack.transform.stepDefineForm.indexPatternLabel": "索引模式",
"xpack.transform.stepDefineForm.invalidKuerySyntaxErrorMessageQueryBar": "查询无效:{errorMessage}",
"xpack.transform.stepDefineForm.maxSubAggsLevelsLimitMessage": "您已达到可在表单中添加的最大子聚合级别数。如果想再添加一个级别,请编辑 JSON 配置。",
Expand Down

0 comments on commit 25e102a

Please sign in to comment.