Skip to content

Commit

Permalink
[Search Relevance] Prepopulate ingest pipeline name using index name (#…
Browse files Browse the repository at this point in the history
…162933)

This PR addresses the enhancement mentioned in this issue:
elastic/search-team#5038

With the changes in this PR, whenever a user attempts to add an
inference pipeline, the pipeline name will be prepopulated with the
index name.

<img width="1631" alt="Screenshot 2023-08-02 at 3 53 15 PM"
src="https://github.com/elastic/kibana/assets/132922331/2e92df5d-79af-4c18-bf7e-ed27cb759957">
<img width="978" alt="Screenshot 2023-08-02 at 3 54 48 PM"
src="https://github.com/elastic/kibana/assets/132922331/5e190fcf-e3eb-4feb-8679-847396c1699d">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
saikatsarkar056 and kibanamachine authored Aug 4, 2023
1 parent 7abdc43 commit d650fd4
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import React from 'react';
import React, { useEffect } from 'react';

import { useValues, useActions } from 'kea';

Expand All @@ -30,6 +30,7 @@ import { i18n } from '@kbn/i18n';

import { docLinks } from '../../../../../shared/doc_links';

import { IndexNameLogic } from '../../index_name_logic';
import { IndexViewLogic } from '../../index_view_logic';

import { InferenceConfiguration } from './inference_config';
Expand Down Expand Up @@ -65,8 +66,17 @@ export const ConfigurePipeline: React.FC = () => {
const { selectExistingPipeline, setInferencePipelineConfiguration } =
useActions(MLInferenceLogic);
const { ingestionMethod } = useValues(IndexViewLogic);
const { indexName } = useValues(IndexNameLogic);

const { existingPipeline, modelID, pipelineName } = configuration;

useEffect(() => {
setInferencePipelineConfiguration({
...configuration,
pipelineName: pipelineName || indexName,
});
}, []);

const nameError = formErrors.pipelineName !== undefined && pipelineName.length > 0;

const modelOptions: Array<EuiSuperSelectOption<string>> = [
Expand Down Expand Up @@ -215,9 +225,7 @@ export const ConfigurePipeline: React.FC = () => {
defaultMessage:
'Pipeline names are unique within a deployment and can only contain letters, numbers, underscores, and hyphens. This will create a pipeline named {pipelineName}.',
values: {
pipelineName: `ml-inference-${
pipelineName.length > 0 ? pipelineName : '<name>'
}`,
pipelineName: `ml-inference-${pipelineName}`,
},
}
)}
Expand Down

0 comments on commit d650fd4

Please sign in to comment.