Änderungen in der Suche

This commit is contained in:
2026-03-11 17:24:14 +01:00
parent 58325e8583
commit dcfadb51d3
5 changed files with 136 additions and 25 deletions

View File

@@ -9,6 +9,7 @@ const { fullTextSearch, getAvailableTables, getTableColumns, SEARCH_CONFIG } = r
router.get('/', async (req, res) => {
try {
const searchTerm = req.query.q;
const statusFilter = req.query.status; // '' | 'aktiv' | 'pruefbar' | 'inaktiv'
if (!searchTerm) {
return res.status(400).json({
@@ -17,7 +18,7 @@ router.get('/', async (req, res) => {
});
}
const results = await fullTextSearch(searchTerm);
const results = await fullTextSearch(searchTerm, statusFilter);
const totalMatches = results.reduce((sum, table) => sum + table.matchCount, 0);
const tableErrors = results.filter(table => table && table.error);