Fixed Search Speed

This commit is contained in:
2025-11-11 08:36:34 +01:00
parent 914c7e4fc1
commit 48263b28b5

View File

@@ -560,7 +560,7 @@ export default async function resourceRoutes(server: FastifyInstance) {
: dataTypes[resource].searchableColumns || [];
const filteredData = (allData || []).filter(row => {
if (searchCols.length === 0) {
/*if (searchCols.length === 0) {
// Fallback: Durchsuche alle String-Felder der Hauptebene
return Object.values(row).some(val =>
JSON.stringify(val).toString().toLowerCase().includes(searchTerm)
@@ -570,7 +570,10 @@ export default async function resourceRoutes(server: FastifyInstance) {
return searchCols.some(col => {
const value = getNestedValue(row, col);
return JSON.stringify(value).toLowerCase().includes(searchTerm);
});
});*/
return JSON.stringify(row).toLowerCase().includes(searchTerm);
});
// 3. Im Backend sortieren