|
@@ -472,76 +472,44 @@ const reset = () => {
|
|
|
},
|
|
|
}
|
|
|
}
|
|
|
-const getData = () => {}
|
|
|
-const init = ({ indexingTechnique, embeddingModelId, indexConfig }) => {
|
|
|
- reset()
|
|
|
- if (props.indexMethod) {
|
|
|
- state.indexMethod.value = indexingTechnique
|
|
|
- }
|
|
|
- if (props.embedding) {
|
|
|
- state.embedding.value = embeddingModelId
|
|
|
+const getData = () => {
|
|
|
+ const result: any = {
|
|
|
+ splitType: state.config.value,
|
|
|
}
|
|
|
- if (props.searchMethod) {
|
|
|
- state.searchMethod.value = indexConfig.type
|
|
|
- switch (state.searchMethod.value) {
|
|
|
- case SearchMethodType.Vector:
|
|
|
- {
|
|
|
- state.searchMethod[SearchMethodType.Vector].isRerank = Number(
|
|
|
- indexConfig.isRerank,
|
|
|
- )
|
|
|
- state.searchMethod[SearchMethodType.Vector].rerank =
|
|
|
- indexConfig.rerankTypeId
|
|
|
- state.searchMethod[SearchMethodType.Vector].topK = Number(
|
|
|
- indexConfig.topK,
|
|
|
- )
|
|
|
- state.searchMethod[SearchMethodType.Vector].isScore = Number(
|
|
|
- indexConfig.isScore,
|
|
|
- )
|
|
|
- state.searchMethod[SearchMethodType.Vector].score = Number(
|
|
|
- indexConfig.score,
|
|
|
- )
|
|
|
- }
|
|
|
- break
|
|
|
- case SearchMethodType.Global:
|
|
|
- {
|
|
|
- state.searchMethod[SearchMethodType.Global].isRerank = Number(
|
|
|
- indexConfig.isRerank,
|
|
|
- )
|
|
|
- state.searchMethod[SearchMethodType.Global].rerank =
|
|
|
- indexConfig.rerankTypeId
|
|
|
- state.searchMethod[SearchMethodType.Global].topK = Number(
|
|
|
- indexConfig.topK,
|
|
|
- )
|
|
|
- state.searchMethod[SearchMethodType.Global].isScore = Number(
|
|
|
- indexConfig.isScore,
|
|
|
- )
|
|
|
- state.searchMethod[SearchMethodType.Global].score = Number(
|
|
|
- indexConfig.score,
|
|
|
- )
|
|
|
- }
|
|
|
- break
|
|
|
- case SearchMethodType.Mix:
|
|
|
- {
|
|
|
- state.searchMethod[SearchMethodType.Mix].indexMethod =
|
|
|
- indexConfig.weightRerank
|
|
|
- state.searchMethod[SearchMethodType.Mix].weight = Number(
|
|
|
- indexConfig.semantics,
|
|
|
- )
|
|
|
- state.searchMethod[SearchMethodType.Mix].rerank =
|
|
|
- indexConfig.rerankTypeId
|
|
|
- state.searchMethod[SearchMethodType.Mix].topK = Number(
|
|
|
- indexConfig.topK,
|
|
|
- )
|
|
|
- state.searchMethod[SearchMethodType.Mix].isScore = Number(
|
|
|
- indexConfig.isScore,
|
|
|
- )
|
|
|
- state.searchMethod[SearchMethodType.Mix].score = Number(
|
|
|
- indexConfig.score,
|
|
|
- )
|
|
|
- }
|
|
|
- break
|
|
|
- }
|
|
|
+ switch (state.config.value) {
|
|
|
+ case StageMethodType.Fixed:
|
|
|
+ {
|
|
|
+ result.maxParentSize = state.config[StageMethodType.Fixed].max
|
|
|
+ result.overlapSize = state.config[StageMethodType.Fixed].overlap
|
|
|
+ result.isNewLine = state.config[StageMethodType.Fixed].replaceBlank
|
|
|
+ result.isEmail = state.config[StageMethodType.Fixed].delUrlEmail
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case StageMethodType.Split:
|
|
|
+ {
|
|
|
+ result.parentSeparator = state.config[StageMethodType.Split].sign
|
|
|
+ result.maxParentSize = state.config[StageMethodType.Split].max
|
|
|
+ result.overlapSize = state.config[StageMethodType.Split].overlap
|
|
|
+ result.isNewLine = state.config[StageMethodType.Split].replaceBlank
|
|
|
+ result.isEmail = state.config[StageMethodType.Split].delUrlEmail
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case StageMethodType.FatherSon:
|
|
|
+ {
|
|
|
+ result.parentSeparator =
|
|
|
+ state.config[StageMethodType.FatherSon].signFather
|
|
|
+ result.maxParentSize = state.config[StageMethodType.FatherSon].maxFather
|
|
|
+ result.childSeparator = state.config[StageMethodType.FatherSon].signSon
|
|
|
+ result.maxChildSize = state.config[StageMethodType.FatherSon].maxSon
|
|
|
+ result.isNewLine = state.config[StageMethodType.FatherSon].replaceBlank
|
|
|
+ result.isEmail = state.config[StageMethodType.FatherSon].delUrlEmail
|
|
|
+ }
|
|
|
+ break
|
|
|
}
|
|
|
+ return result
|
|
|
+}
|
|
|
+const init = ({ contentConfig }) => {
|
|
|
+ reset()
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
initDictionary()
|