查询优化

This commit is contained in:
JenniferW 2026-01-14 14:11:26 +08:00
parent f8eb9d889d
commit 1fc7bcb5f2
3 changed files with 21 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 124 KiB

BIN
src/assets/images/logo2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

View File

@ -1497,7 +1497,6 @@ const handleInput = (value, options = {}) => {
if (currentPart) { if (currentPart) {
scheduleSearchHint(currentPart); scheduleSearchHint(currentPart);
} }
// differenceWords
}; };
const fetchSearchHints = async (keyword) => { const fetchSearchHints = async (keyword) => {
@ -1532,20 +1531,36 @@ const fetchSearchHints = async (keyword) => {
} }
} }
// queryType
const preciseIndexSet = getPreciseIndexSet();
// fieldConditions使 // fieldConditions使
const fieldConditions = conditionsToProcess const fieldConditions = conditionsToProcess
.filter((condition) => { .filter((condition) => {
// ":" // ":"
return condition.value || (condition.fieldLabel && condition.field); return condition.value || (condition.fieldLabel && condition.field);
}) })
.map((condition) => { .map((condition, index) => {
//
//
const originalIndex = parsedConditions.value.findIndex(
(c) =>
c.fieldLabel === condition.fieldLabel &&
c.value === condition.value &&
c.field === condition.field
);
// 使
const finalIndex = originalIndex !== -1 ? originalIndex : index;
// queryType buildFieldConditionsPayload
const queryType = preciseIndexSet.has(finalIndex) ? "EXACT" : "FUZZY";
// 1 + // 1 +
if (condition.valid && condition.field && condition.value) { if (condition.valid && condition.field && condition.value) {
return { return {
fieldName: condition.field, fieldName: condition.field,
fieldValue: condition.value, fieldValue: condition.value,
keyword: "", keyword: "",
queryType: "FUZZY", queryType,
}; };
} }
@ -1555,7 +1570,7 @@ const fetchSearchHints = async (keyword) => {
fieldName: condition.field, fieldName: condition.field,
fieldValue: "", fieldValue: "",
keyword: "", keyword: "",
queryType: "FUZZY", queryType,
}; };
} }
@ -1572,7 +1587,7 @@ const fetchSearchHints = async (keyword) => {
// fieldName: "", // fieldName: "",
// fieldValue: condition.value, // fieldValue: condition.value,
// keyword: "", // keyword: "",
// queryType: "FUZZY", // queryType,
// }; // };
// } // }
// // 4 keyword // // 4 keyword
@ -1588,7 +1603,7 @@ const fetchSearchHints = async (keyword) => {
fieldName: "", fieldName: "",
fieldValue: "", fieldValue: "",
keyword, keyword,
queryType: "FUZZY", queryType,
}; };
}); });