diff --git a/web/app/components/datasets/common/retrieval-method-config/index.tsx b/web/app/components/datasets/common/retrieval-method-config/index.tsx index 0244a13655..986135e3c6 100644 --- a/web/app/components/datasets/common/retrieval-method-config/index.tsx +++ b/web/app/components/datasets/common/retrieval-method-config/index.tsx @@ -104,7 +104,7 @@ const RetrievalMethodConfig: FC = ({ title={
{t('dataset.retrieval.hybrid_search.title')}
- +
} description={t('dataset.retrieval.hybrid_search.description')} isActive={ diff --git a/web/app/components/datasets/settings/form/index.tsx b/web/app/components/datasets/settings/form/index.tsx index 7ce31986c1..22b52bb8f2 100644 --- a/web/app/components/datasets/settings/form/index.tsx +++ b/web/app/components/datasets/settings/form/index.tsx @@ -17,7 +17,7 @@ import Textarea from '@/app/components/base/textarea' import Divider from '@/app/components/base/divider' import { ApiConnectionMod } from '@/app/components/base/icons/src/vender/solid/development' import { updateDatasetSetting } from '@/service/datasets' -import type { DataSetListResponse } from '@/models/datasets' +import { type DataSetListResponse } from '@/models/datasets' import DatasetDetailContext from '@/context/dataset-detail' import { type RetrievalConfig } from '@/types/app' import { useAppContext } from '@/context/app-context' @@ -234,6 +234,7 @@ const Form = () => { disable={!currentDataset?.embedding_available} value={indexMethod} onChange={v => setIndexMethod(v)} + docForm={currentDataset.doc_form} /> diff --git a/web/app/components/datasets/settings/index-method-radio/index.tsx b/web/app/components/datasets/settings/index-method-radio/index.tsx index 2bf6f36ce1..e563b96256 100644 --- a/web/app/components/datasets/settings/index-method-radio/index.tsx +++ b/web/app/components/datasets/settings/index-method-radio/index.tsx @@ -1,8 +1,10 @@ 'use client' import { useTranslation } from 'react-i18next' +import { IndexingType } from '../../create/step-two' import s from './index.module.css' import classNames from '@/utils/classnames' import type { DataSet } from '@/models/datasets' +import { ChuckingMode } from '@/models/datasets' const itemClass = ` w-full sm:w-[234px] p-3 rounded-xl bg-gray-25 border border-gray-100 cursor-pointer @@ -15,6 +17,7 @@ type IIndexMethodRadioProps = { onChange: (v?: DataSet['indexing_technique']) => void disable?: boolean itemClassName?: string + docForm?: ChuckingMode } const IndexMethodRadio = ({ @@ -22,6 +25,7 @@ const IndexMethodRadio = ({ onChange, disable, itemClassName, + docForm, }: IIndexMethodRadioProps) => { const { t } = useTranslation() const options = [ @@ -42,29 +46,35 @@ const IndexMethodRadio = ({ return (
{ - options.map(option => ( -
{ - if (!disable) - onChange(option.key as DataSet['indexing_technique']) - }} - > -
-
-
{option.text}
-
+ options.map((option) => { + const isParentChild = docForm === ChuckingMode.parentChild + return ( +
{ + if (isParentChild && option.key === IndexingType.ECONOMICAL) + return + if (!disable) + onChange(option.key as DataSet['indexing_technique']) + }} + > +
+
+
{option.text}
+
+
+
{option.desc}
-
{option.desc}
-
- )) + ) + }) }
)