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