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
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)

4 Replies
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 searchoh, I thought it was syntax LOL. I thought full text search it will search every column with that word
Haha, all good 🙂
Let me know if you run into any other issues.
Thank you so much