Hi everyone! I've been working on getting full-te...
# orm-help
d
Hi everyone! I've been working on getting full-text search indexes (with
pg_trgm
) ready for the next release of Prisma Util and I was wondering what you think about this configuration example. Should I change anything or keep it like this?
Copy code
ftsIndexes: {
  "base.prisma:Post": {
     type: "GIN",
     indexes: [{ language: "english", field: "title", weight: "A"}]
  }
}
💬 1
n
Will all these indexes - GIN, GiST, SP-GiST and BRIN follow a similar structure like the example that you shared?
d
@Nurul Yes, and you should be able to query it just by doing:
Copy code
prisma.post.findMany({
    where: {
        title: "query | sql"
    }
});
All you have to do to enable this full text search support is to create the indexes in the configuration file and add the middleware to Prisma:
Copy code
import middleware from "./middleware";
prisma.$use(middleware);
🙌 1