docs icon indicating copy to clipboard operation
docs copied to clipboard

Prisma docs are misleading when sorting by relevance

Open sean-ac opened this issue 1 year ago • 0 comments

On this page:

https://www.prisma.io/docs/concepts/components/prisma-client/filtering-and-sorting#sort-by-relevance-postgresql

It gives the example code:

const getUsersByRelevance = await prisma.user.findMany({
  take: 10,
  orderBy: {
    _relevance: {
      fields: ['bio'],
      search: 'developer',
      sort: 'asc',
    },
  },
})

The sort should probably be set to 'desc' for most people, if you're using PostgreSQL -- assuming you want the highest relevant results returned first, which I would think the vast majority of people want.

sean-ac avatar Apr 07 '23 15:04 sean-ac