Comments (3)
Hi @kodwi.
Could you please share your prisma schema? Thank you.
from prisma.
@SevInf sure
generator client {
provider = "prisma-client-js"
previewFeatures = ["fullTextSearch"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Country {
id Int @id @default(autoincrement())
name String @unique
cities City[]
}
model City {
id Int @id @default(autoincrement())
name String
region String
countryId Int
country Country @relation(fields: [countryId], references: [id])
locations Location[]
}
model Location {
id String @id @default(uuid())
cityId Int
city City @relation(fields: [cityId], references: [id])
address String?
latitude Float?
longitude Float?
}
from prisma.
@kodwi
I faced exactly the same problem than you. If you look for a field with a space and that there is a result for it, I have the same error.
I've came up with this workaround for now: I'm just replacing spaces by comas in the searched terms. You still have the correct results in the right order.
In your example it would do:
this._prismaService.country.findMany({
where: {
name: {
contains: searchText,
mode: 'insensitive',
},
},
orderBy: {
_relevance: {
fields: ['name'],
search: searchText.split(' ').join(','),
sort: 'desc',
},
},
take: COMMON.COUNTRY_COUNT,
});
from prisma.
Related Issues (20)
- Allow configuring version mismatch to be an error HOT 1
- Add a `dry-run` option to prisma generate HOT 6
- Prisma weird return type
- The edge runtime does not support Node.js 'crypto' module. - when trying to use `@prisma/adapter-pg` in Next.js middleware HOT 5
- [Internal] Function tests: Enable query logging via CLI parameter
- Error: PrismaClient is not configured to run in Vercel Edge Functions or Edge Middleware
- Why can't I access password in user? (ORM) (Postgres-Supabase)
- binaries.prisma.sh Returns 404 Not Found Error
- Introduce `connectOrSkip` for optional `connect` operations HOT 2
- Creating and including a related object returns trimmed numbers with `relationJoins`
- `wasm-edge-light-loader.js` importing `node:crypto` instead of using `globalThis.crypto` HOT 11
- Insert or update an item without returning it HOT 3
- Performance problems with batched `findUnique()` HOT 6
- Can't use Prisma Client in Next.js middleware with `@prisma/adapter-pg` and `pg`, even locally HOT 13
- Docs include incorrect information regarding Vercel deployment fix HOT 3
- Add support for `pre`/`post` validation hooks in Prisma schema HOT 3
- Introspecting error with "Microsoft SQL Server 2019" database HOT 1
- Batched `findUnique()` is not chunked and exceeds parameter binding limits HOT 2
- Gin/Gist index operator classes brought in via PostgreSQL extensions
- Accelerate: "Invalid client engine type, please use `library` or `binary`" on Edge HOT 23
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma.