Skip to content

Commit e88c5fb

Browse files
author
Lasim
committed
fix(backend): replace like with ilike for case-insensitive search
1 parent 8f5bd9f commit e88c5fb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

services/backend/src/services/mcpCatalogService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
2-
import { eq, and, or, like, desc, asc } from 'drizzle-orm';
2+
import { eq, and, or, ilike, desc, asc } from 'drizzle-orm';
33
import { getSchema } from '../db/index';
44
import type { AnyDatabase } from '../db';
55
import type { FastifyBaseLogger } from 'fastify';
@@ -297,16 +297,16 @@ export class McpCatalogService {
297297
const searchTerm = `%${filters.search}%`;
298298
whereConditions.push(
299299
or(
300-
like(this.mcpServers.name, searchTerm),
301-
like(this.mcpServers.description, searchTerm),
302-
like(this.mcpServers.tags, searchTerm)
300+
ilike(this.mcpServers.name, searchTerm),
301+
ilike(this.mcpServers.description, searchTerm),
302+
ilike(this.mcpServers.tags, searchTerm)
303303
)
304304
);
305305
}
306306
if (filters.tags) {
307307
const tagList = filters.tags.split(',').map(tag => tag.trim()).filter(tag => tag.length > 0);
308308
if (tagList.length > 0) {
309-
const tagConditions = tagList.map(tag => like(this.mcpServers.tags, `%${tag}%`));
309+
const tagConditions = tagList.map(tag => ilike(this.mcpServers.tags, `%${tag}%`));
310310
whereConditions.push(or(...tagConditions));
311311
}
312312
}

0 commit comments

Comments
 (0)