Fixed Search Speed
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user