P
Prisma•7d ago
Sa3eeD

full Text Search not working with Postgres and Nextjs

Hello, I have a problem with trying to use Full Text Search with Prisma ORM. I have followed the guide in Prisma docs, but I still get this error. I posted a snapshot of prima file and the code we have in the docs.
Here is the error: Invalid prisma.question.findMany() invocation: { include: { mc: true }, where: { body: { ~~~~ search: "cat" }, ? AND?: QuestionWhereInput | QuestionWhereInput[], ? OR?: QuestionWhereInput[], ? NOT?: QuestionWhereInput | QuestionWhereInput[], ? id?: IntFilter | Int, ? title?: StringFilter | String, ? tags?: StringNullableListFilter, ? category?: StringFilter | String, ? creator_id?: IntFilter | Int, ? created_at?: DateTimeFilter | DateTime, ? updated_at?: DateTimeFilter | DateTime, ? reviwer?: StringFilter | String, ? reviwed?: BoolFilter | Boolean, ? status?: StringFilter | String, ? version?: IntFilter | Int, ? stem?: StringFilter | String, ? score?: IntFilter | Int, ? notes?: StringFilter | String, ? mc?: ChoicesListRelationFilter, ? User?: UserScalarRelationFilter | UserWhereInput, ? Tests?: TestListRelationFilter } } Unknown argument body. Did you mean id? Available options are marked with ?. at async POST (./app/api/questions/search/route.tsx:13:18)
No description
No description
4 Replies
Nurul
Nurul•6d ago
Hey 👋 Is there a field named body in the question model? In the docs, body was an example column name, here instead of body you should use the column name on which you want to do full text search
Sa3eeD
Sa3eeDOP•6d ago
oh, I thought it was syntax LOL. I thought full text search it will search every column with that word
Nurul
Nurul•5d ago
Haha, all good 🙂 Let me know if you run into any other issues.
Sa3eeD
Sa3eeDOP•4d ago
Thank you so much

Did you find this page helpful?