N
Neon2y ago
optimistic-gold

Is @@fulltext feature can be used?

Hello! This is my schema file: generator client { provider = "prisma-client-js" previewFeatures = ["fullTextSearch","fullTextIndex"] } datasource db { provider = "postgresql" url = env("DATABASE_URL") } model Category { id String @id @db.Uuid @default(dbgenerated("gen_random_uuid()")) name String companions Companion[] } model Companion { id String @id @db.Uuid @default(dbgenerated("gen_random_uuid()")) userId String userName String src String name String @db.Text description String instruction String @db.Text seed String @db.Text createdAt DateTime @default(dbgenerated("now()")) updatedAt DateTime @updatedAt category Category @relation(fields: [categoryId], references: [id]) categoryId String @@index([categoryId]) @@fulltext([name]) } The only error I get is because of @@fulltext([name]) Error parsing attribute "@@fulltext": Defining fulltext indexes is not supported with the current connector. I tried to put previewFeatures = ["fullTextSearch","fullTextIndex"] but I still got the same issue Is Neon really don't support @@fulltext Search? Thank you! Best wishes
2 Replies
foreign-sapphire
foreign-sapphire2y ago
Hey looks like this is a Prisma limitation with Postgres. https://www.prisma.io/docs/orm/prisma-client/queries/full-text-search#postgresql-1 Postgres itself supports full-text search so their might be some workarounds
Full-text search (Preview) | Prisma Documentation
This page explains how to search for text within a field.
foreign-sapphire
foreign-sapphire2y ago
seems like there's more discussion on the topic in the github thread here https://github.com/prisma/prisma/issues/8950
GitHub
Postgres Full-Text Search Index is not used · Issue #8950 · prisma/...
Bug description Current FTS appear to not use defined GIN or GIST index Recommended GIN index in doc is also not working ERROR: data type text has no default operator class for access method "...

Did you find this page helpful?