Hello, I wanted to use full text search with next.js 13. but some just came up.
//schema.prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["fullTextSearch", "fullTextIndex"]
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
relationMode = "prisma"
}
model apartment {
id Int @id @default(autoincrement())
name String @db.VarChar(50)
@@fulltext([name])
}
//route.ts
const apartment = await prisma.apartment.findMany({
where: {
name: {
search: "word",
},
},
});
there's no error and result....
what is wrong with my codes?
Is there the right data in your database?