#Returning nothing when using full text search

4 messages · Page 1 of 1 (latest)

wide blade
#

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?

twin siren
wide blade
#

Yes. For example, ```javascript
where: {
name: {
contains : "word"
}
}

works fine.
twin siren