From 7249237ff03fb4366c15c2591e925c872c5292da Mon Sep 17 00:00:00 2001 From: Lucy Keer Date: Fri, 7 Jan 2022 11:35:54 +0000 Subject: [PATCH 01/13] Update 060-full-text-search.mdx Update with MySQL functionality --- .../02-prisma-client/060-full-text-search.mdx | 186 ++++++++++++++---- 1 file changed, 151 insertions(+), 35 deletions(-) diff --git a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx index 2ef06befc2..e758af1f6d 100644 --- a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx +++ b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx @@ -7,39 +7,59 @@ preview: true # Full-Text Search (Preview) -The Prisma Client supports a full-text search API for Postgres databases. With full-text search enabled, you can add search functionality to your application by searching for text within a database column. +The Prisma Client supports full-text search API for **PostgreSQL** and **MySQL** databases. With full-text search enabled, you can add search functionality to your application by searching for text within a database column. - +## Enabling full-text search -**Note**: Full text search can **only** be used in a Postgres database - - - -## Enable full-text search - -The full-text Search API is still in **Preview**. You can enable `fullTextSearch` in your Prisma Schema: +The `fullTextSearch` feature is currently a Preview feature. To enable this feature, carry out the following steps: 1. Update the [`previewFeatures`](/concepts/components/preview-features) block in your schema: - ```prisma + ```prisma file=schema.prisma generator client { provider = "prisma-client-js" previewFeatures = ["fullTextSearch"] } ``` + For MySQL, you will also need to include the `fullTextIndex` preview feature: + + ```prisma file=schema.prisma highlight=3;add + generator client { + provider = "prisma-client-js" + previewFeatures = ["fullTextSearch, fullTextIndex"] + } + ``` + 2. Generate the Prisma Client: ```terminal copy npx prisma generate ``` -After you regenerate your client, a new `search` field will be available on any `String` fields created on your models. +After you regenerate your client, a new `search` field will be available on any `String` fields created on your models. For example, the following search will return all posts that contain the word 'cat'. + +```ts +// All posts that contain the word 'cat'. +const result = await prisma.posts.findMany({ + where: { + body: { + search: 'cat', + }, + }, +}) +``` -### Example of new search field +## Querying the database + +The `search` field uses the database's native querying capabilities under the hood. This means that the exact operations available will be database-specific. + +### PostgreSQL + +The following examples demonstrate use of the PostgreSQL 'and' (`&`) and 'or' (`|`) operators: ```ts -// All posts that contain the words cat or dog. +// All posts that contain the words 'cat' or 'dog'. const result = await prisma.posts.findMany({ where: { body: { @@ -48,7 +68,7 @@ const result = await prisma.posts.findMany({ }, }) -// All drafts that contain the words cat and dog. +// All drafts that contain the words 'cat' and 'dog'. const result = await prisma.posts.findMany({ where: { status: 'Draft', @@ -59,9 +79,58 @@ const result = await prisma.posts.findMany({ }) ``` -## Query Format +To get a sense of how the query format works, consider the following text: + +**"The quick brown fox jumps over the lazy dog"** + +Here's how the following queries would match that text: + +| Query | Match? | Description | +| :-------------------------------------- | :----- | :-------------------------------------- | +| `fox & dog` | Yes | The text contains 'fox' and 'dog' | +| `dog & fox` | Yes | The text contains 'dog' and 'fox' | +| `dog & cat` | No | The text contains 'dog' but not 'cat' | +| `!cat` | Yes | 'cat' is not in the text | +| fox | cat | Yes | The text contains 'fox' or 'cat' | +| cat | pig | No | The text doesn't contain 'cat' or 'pig' | +| `fox <-> dog` | Yes | 'dog' follows 'fox' in the text | +| `dog <-> fox` | No | 'fox' doesn't follow 'dog' in the text | -The `search` field uses the database's native querying capabilities under the hood. This means that the Prisma Client [supports what the database supports](https://www.postgresql.org/docs/12/functions-textsearch.html). +For the full range of supported operations, see the [PostgreSQL full text search documentation](https://www.postgresql.org/docs/12/functions-textsearch.html). + +### MySQL + +The following examples demonstrate use of the MySQL 'and' (`+`) and 'not' (`-`) operators: + +```ts +// All posts that contain the words 'cat' or 'dog'. +const result = await prisma.posts.findMany({ + where: { + body: { + search: 'cat dog', + }, + }, +}) + +// All posts that contain the words 'cat' and not 'dog'. +const result = await prisma.posts.findMany({ + where: { + body: { + search: '+cat -dog', + }, + }, +}) + +// All drafts that contain the words 'cat' and 'dog'. +const result = await prisma.posts.findMany({ + where: { + status: 'Draft', + body: { + search: '+cat +dog', + }, + }, +}) +``` To get a sense of how the query format works, consider the following text: @@ -69,31 +138,78 @@ To get a sense of how the query format works, consider the following text: Here's how the following queries would match that text: -| Query | Match? | Description | -| :-------------------------------------- | :----- | :---------------------------------- | -| `fox & dog` | Yes | The text contains fox and dog | -| `dog & fox` | Yes | The text contains dog and fox | -| `dog & cat` | No | The text doesn't contain cat | -| `!cat` | Yes | There is not cat in the text | -| fox | cat | Yes | The text contains fox or cat | -| cat | pig | No | The text doesn't contain cat or pig | -| `fox <-> dog` | Yes | dog follows fox in the text | -| `dog <-> fox` | No | dog doesn't follow fox in the text | +| Query | Match? | Description | +| :---------- | :----- | :-------------------------------------- | +| `+fox +dog` | Yes | The text contains 'fox' and 'dog' | +| `+dog +fox` | Yes | The text contains 'dog' and 'fox' | +| `+dog +cat` | No | The text contains 'dog' but not 'cat' | +| `-cat` | Yes | 'cat' is not in the text | +| `fox dog` | Yes | The text contains 'fox' or 'cat' | +| `-cat -pig` | No | The text doesn't contain 'cat' or 'pig' | + +For the full range of supported operations, see the [MySQL full text search documentation](https://dev.mysql.com/doc/refman/8.0/en/fulltext-boolean.html). + +## Adding indexes -## Adding Indexes +### PostgreSQL -To speed up your full-text queries, you should add an index to your database. -Prisma Migrate currently doesn't support adding search indices, but you can -easily add one yourself. +To speed up your full-text queries, you should add an index to your database. Prisma Migrate currently doesn't support adding search indices in PostgreSQL, so this should be added in SQL. For example, the following SQL statement would add an index called `post_body_index` on the `posts_body_index` column of the `posts` table: ```sql CREATE INDEX post_body_index ON posts USING GIN (body); ``` -You can continue using Prisma Migrate as you were before, it will ignore indexes -that it doesn't know about. +For further information, see the [Postgres documentation on indexes](https://www.postgresql.org/docs/12/sql-createindex.html). + +You can continue using Prisma Migrate as you were before, it will ignore indexes that it doesn't know about. + +### MySQL + +For MySQL, it is necessary to add indexes to any columns you search using the `@@fulltext` argument in the `schema.prisma` file. To do this, the `"fullTextIndex"` preview feature must be enabled. + +In the following example, one full text index is added to the `content` field of the `Blog` model, and another is added to both the `content` and `title` fields together: + +```prisma file=schema.prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["fullTextSearch", "fullTextIndex"] +} + +model Blog { + id Int @unique + content String + title String -## Limitations + @@fulltext([content]) + @@fulltext([content, title]) +} +``` + +The first index allows searching the `content` field for occurrences of the word 'cat': + +```prisma file=schema.prisma +const result = await prisma.blogs.findMany({ +where: { +content: { +search: 'cat', +}, +}, +}) +``` + +The second index allows searching both the `content` and `title` fields for occurrences of the word 'cat' in the `content` and 'food' in the `title`: + +```prisma file=schema.prisma +const result = await prisma.blogs.findMany({ +where: { +content: { +search: 'cat', +}, +title: { +search: 'food' +} +}, +}) +``` -- The `search` field is only supported in PostgreSQL -- You'll need to manage indexes yourself. +However, if you try to search on `title` alone, the search will fail with the error "Cannot find a fulltext index to use for the search and the message code is P2030", because the index requires a search on both fields. From 51aec8ffb1e926d0a8bd624bfc916730b496086b Mon Sep 17 00:00:00 2001 From: Lucy Keer Date: Mon, 10 Jan 2022 10:18:47 +0000 Subject: [PATCH 02/13] Update 060-full-text-search.mdx Fix capitalisation of title --- .../100-components/02-prisma-client/060-full-text-search.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx index e758af1f6d..70ef07ccf1 100644 --- a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx +++ b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx @@ -1,6 +1,6 @@ --- -title: 'Full-Text Search' -metaTitle: 'Full-Text Search (Preview)' +title: 'Full-text search' +metaTitle: 'Full-text search (Preview)' metaDescription: 'This page explains how to search for text within a field.' preview: true --- From fb76fcda2532eae21e0a152ad8b66d80d9e69bf9 Mon Sep 17 00:00:00 2001 From: Lucy Keer Date: Mon, 10 Jan 2022 10:19:24 +0000 Subject: [PATCH 03/13] Update 060-full-text-search.mdx Remove second title and add TopBlock --- .../02-prisma-client/060-full-text-search.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx index 70ef07ccf1..0666441a0d 100644 --- a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx +++ b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx @@ -5,9 +5,11 @@ metaDescription: 'This page explains how to search for text within a field.' preview: true --- -# Full-Text Search (Preview) + -The Prisma Client supports full-text search API for **PostgreSQL** and **MySQL** databases. With full-text search enabled, you can add search functionality to your application by searching for text within a database column. +The Prisma Client supports full-text search for **PostgreSQL** and **MySQL** databases. With full-text search enabled, you can add search functionality to your application by searching for text within a database column. + + ## Enabling full-text search From 5749ba3ef1bbcd930b507e3c703fee4d32f64dfc Mon Sep 17 00:00:00 2001 From: Lucy Keer Date: Mon, 10 Jan 2022 10:20:01 +0000 Subject: [PATCH 04/13] Update 060-full-text-search.mdx Fix TypeScript formatting of examples --- .../02-prisma-client/060-full-text-search.mdx | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx index 0666441a0d..8d40c328cd 100644 --- a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx +++ b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx @@ -189,28 +189,28 @@ model Blog { The first index allows searching the `content` field for occurrences of the word 'cat': -```prisma file=schema.prisma +```ts const result = await prisma.blogs.findMany({ -where: { -content: { -search: 'cat', -}, -}, + where: { + content: { + search: 'cat', + }, + }, }) ``` The second index allows searching both the `content` and `title` fields for occurrences of the word 'cat' in the `content` and 'food' in the `title`: -```prisma file=schema.prisma +```ts const result = await prisma.blogs.findMany({ -where: { -content: { -search: 'cat', -}, -title: { -search: 'food' -} -}, + where: { + content: { + search: 'cat', + }, + title: { + search: 'food', + }, + }, }) ``` From a0c570d2ded7ee0bfe390bcf4aae371ff3f4bb5a Mon Sep 17 00:00:00 2001 From: Lucy Keer Date: Mon, 10 Jan 2022 10:20:46 +0000 Subject: [PATCH 05/13] Update 060-full-text-search.mdx Add more MySQL full text search examples --- .../02-prisma-client/060-full-text-search.mdx | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx index 8d40c328cd..60fb5dba0e 100644 --- a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx +++ b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx @@ -140,14 +140,29 @@ To get a sense of how the query format works, consider the following text: Here's how the following queries would match that text: -| Query | Match? | Description | -| :---------- | :----- | :-------------------------------------- | -| `+fox +dog` | Yes | The text contains 'fox' and 'dog' | -| `+dog +fox` | Yes | The text contains 'dog' and 'fox' | -| `+dog +cat` | No | The text contains 'dog' but not 'cat' | -| `-cat` | Yes | 'cat' is not in the text | -| `fox dog` | Yes | The text contains 'fox' or 'cat' | -| `-cat -pig` | No | The text doesn't contain 'cat' or 'pig' | +| Query | Match? | Description | +| :------------- | :----- | :----------------------------------------------------- | +| `+fox +dog` | Yes | The text contains 'fox' and 'dog' | +| `+dog +fox` | Yes | The text contains 'dog' and 'fox' | +| `+dog -cat` | No | The text contains 'dog' but not 'cat' | +| `-cat` | Yes | 'cat' is not in the text | +| `fox dog` | Yes | The text contains 'fox' or 'cat' | +| `-cat -pig` | No | The text does not contain 'cat' or 'pig' | +| `quic*` | Yes | The text contains a word starting with 'quic' | +| `quick fox @2` | Yes | 'fox' starts within a 2 word distance of 'quick' | +| `fox dog @2` | No | 'dog' does not start within a 2 word distance of 'fox' | +| `"jumps over"` | Yes | The text contains the whole phrase 'jumps over' | + +MySQL also has `>`, `<` and `~` operators for altering the ranking order of search results. As an example, consider the following two records: + +**1. "The quick brown fox jumps over the lazy dog"** + +**2. "The quick brown fox jumps over the lazy cat"** + +| Query | Result | Description | +| :---------------- | :----------------------- | :------------------------------------------------------------------------------------------------------ | +| `fox ~cat` | Return 1. first, then 2. | Return all records containing 'fox', but rank records containing 'cat' lower | +| `fox (dog)` | Return 1. first, then 2. | Return all records containing 'fox', but rank records containing 'cat' lower than rows containing 'dog' | For the full range of supported operations, see the [MySQL full text search documentation](https://dev.mysql.com/doc/refman/8.0/en/fulltext-boolean.html). From 237893938727756195519ceb893a040af0078cff Mon Sep 17 00:00:00 2001 From: Lucy Keer Date: Mon, 10 Jan 2022 10:22:38 +0000 Subject: [PATCH 06/13] Update content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx Co-authored-by: Jan Piotrowski --- .../100-components/02-prisma-client/060-full-text-search.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx index 60fb5dba0e..8a63b0a9a0 100644 --- a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx +++ b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx @@ -54,7 +54,7 @@ const result = await prisma.posts.findMany({ ## Querying the database -The `search` field uses the database's native querying capabilities under the hood. This means that the exact operations available will be database-specific. +The `search` field uses the database's native querying capabilities under the hood. This means that the exact operations available are also database-specific. ### PostgreSQL From 9269f99b31b05479f8a875ad2b1e68490f96e5e5 Mon Sep 17 00:00:00 2001 From: Lucy Keer Date: Mon, 10 Jan 2022 10:22:59 +0000 Subject: [PATCH 07/13] Update content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx --- .../100-components/02-prisma-client/060-full-text-search.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx index 8a63b0a9a0..2d77ccdc3b 100644 --- a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx +++ b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx @@ -229,4 +229,4 @@ const result = await prisma.blogs.findMany({ }) ``` -However, if you try to search on `title` alone, the search will fail with the error "Cannot find a fulltext index to use for the search and the message code is P2030", because the index requires a search on both fields. +However, if you try to search on `title` alone, the search will fail with the error "Cannot find a fulltext index to use for the search" and the message code is P2030, because the index requires a search on both fields. From 2f01deb5fc129a4e4f4c366cdf8a8b0d8bb62114 Mon Sep 17 00:00:00 2001 From: Lucy Keer Date: Mon, 10 Jan 2022 10:43:15 +0000 Subject: [PATCH 08/13] Update 060-full-text-search.mdx Include version information in introduction --- .../100-components/02-prisma-client/060-full-text-search.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx index 2d77ccdc3b..11b98e7c45 100644 --- a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx +++ b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx @@ -7,7 +7,7 @@ preview: true -The Prisma Client supports full-text search for **PostgreSQL** and **MySQL** databases. With full-text search enabled, you can add search functionality to your application by searching for text within a database column. +The Prisma Client supports full-text search for **PostgreSQL** databases in versions 2.30.0 and later, and **MySQL** databases in versions 3.8.0 and later. With full-text search enabled, you can add search functionality to your application by searching for text within a database column. From ff50902d449ddd86fda8258fbcc35a2be1352629 Mon Sep 17 00:00:00 2001 From: Lucy Keer Date: Mon, 10 Jan 2022 10:43:49 +0000 Subject: [PATCH 09/13] Update 060-full-text-search.mdx Clarify terminology for feature vs feature flag --- .../02-prisma-client/060-full-text-search.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx index 11b98e7c45..93bd89a1e3 100644 --- a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx +++ b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx @@ -13,9 +13,9 @@ The Prisma Client supports full-text search for **PostgreSQL** databases in vers ## Enabling full-text search -The `fullTextSearch` feature is currently a Preview feature. To enable this feature, carry out the following steps: +The full-text search API is currently a Preview feature. To enable this feature, carry out the following steps: -1. Update the [`previewFeatures`](/concepts/components/preview-features) block in your schema: +1. Update the [`previewFeatures`](/concepts/components/preview-features) block in your schema to include the `fullTextSearch` preview feature flag: ```prisma file=schema.prisma generator client { @@ -24,7 +24,7 @@ The `fullTextSearch` feature is currently a Preview feature. To enable this feat } ``` - For MySQL, you will also need to include the `fullTextIndex` preview feature: + For MySQL, you will also need to include the `fullTextIndex` preview feature flag: ```prisma file=schema.prisma highlight=3;add generator client { From 21861c74ea03f768dd7f1695abe81b90603b5219 Mon Sep 17 00:00:00 2001 From: Lucy Keer Date: Tue, 11 Jan 2022 09:45:30 +0000 Subject: [PATCH 10/13] Update content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx Co-authored-by: Alex Ruheni <33921841+ruheni@users.noreply.github.com> --- .../100-components/02-prisma-client/060-full-text-search.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx index 93bd89a1e3..37612761cf 100644 --- a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx +++ b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx @@ -58,7 +58,7 @@ The `search` field uses the database's native querying capabilities under the ho ### PostgreSQL -The following examples demonstrate use of the PostgreSQL 'and' (`&`) and 'or' (`|`) operators: +The following examples demonstrate the use of the PostgreSQL 'and' (`&`) and 'or' (`|`) operators: ```ts // All posts that contain the words 'cat' or 'dog'. From 69abab1e6011c90e0f1659357bb586a9ff98a44f Mon Sep 17 00:00:00 2001 From: Lucy Keer Date: Tue, 11 Jan 2022 10:34:13 +0000 Subject: [PATCH 11/13] Update 060-full-text-search.mdx Update link to PostgreSQL documentation on full text indexes specifically --- .../100-components/02-prisma-client/060-full-text-search.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx index 37612761cf..6d0423518d 100644 --- a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx +++ b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx @@ -176,7 +176,7 @@ To speed up your full-text queries, you should add an index to your database. Pr CREATE INDEX post_body_index ON posts USING GIN (body); ``` -For further information, see the [Postgres documentation on indexes](https://www.postgresql.org/docs/12/sql-createindex.html). +For further information, see the [PostgreSQL documentation on indexes](https://www.postgresql.org/docs/12/textsearch-tables.html#TEXTSEARCH-TABLES-INDEX). You can continue using Prisma Migrate as you were before, it will ignore indexes that it doesn't know about. From 14c94562c1d1930de4b2db5f26d78a452c452a5c Mon Sep 17 00:00:00 2001 From: Lucy Keer Date: Tue, 11 Jan 2022 10:37:58 +0000 Subject: [PATCH 12/13] Update content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx Co-authored-by: Alex Ruheni <33921841+ruheni@users.noreply.github.com> --- .../100-components/02-prisma-client/060-full-text-search.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx index 6d0423518d..ede67f29f4 100644 --- a/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx +++ b/content/200-concepts/100-components/02-prisma-client/060-full-text-search.mdx @@ -229,4 +229,4 @@ const result = await prisma.blogs.findMany({ }) ``` -However, if you try to search on `title` alone, the search will fail with the error "Cannot find a fulltext index to use for the search" and the message code is P2030, because the index requires a search on both fields. +However, if you try to search on `title` alone, the search will fail with the error "Cannot find a fulltext index to use for the search" and the message code is `P2030`, because the index requires a search on both fields. From 98a73e479891d30922f756c2f70b377dfb61750d Mon Sep 17 00:00:00 2001 From: Lucy Keer Date: Tue, 11 Jan 2022 10:39:15 +0000 Subject: [PATCH 13/13] Update 250-error-reference.mdx Add P2030 fulltext error to the error reference --- .../200-api-reference/250-error-reference.mdx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/content/400-reference/200-api-reference/250-error-reference.mdx b/content/400-reference/200-api-reference/250-error-reference.mdx index 26db4dea0e..6d9f457a5a 100644 --- a/content/400-reference/200-api-reference/250-error-reference.mdx +++ b/content/400-reference/200-api-reference/250-error-reference.mdx @@ -59,11 +59,11 @@ Errors that can occur include: - A missing or inaccessible environment variable - The query engine binary for the current platform could not be found (`generator` block) -| **Property** | **Description** | -| :-------------- | :----------------------------------------------- | -| `errorCode` | A Prisma-specific error code. | -| `message` | Error message associated with [error code](#error-codes). | -| `clientVersion` | Version of Prisma Client (for example, `2.19.0`) | +| **Property** | **Description** | +| :-------------- | :-------------------------------------------------------- | +| `errorCode` | A Prisma-specific error code. | +| `message` | Error message associated with [error code](#error-codes). | +| `clientVersion` | Version of Prisma Client (for example, `2.19.0`) | ### PrismaClientValidationError @@ -72,9 +72,9 @@ Prisma Client throws a `PrismaClientValidationError` exception if validation fai - Missing field - for example, an empty `data: {}` property when creating a new record - Incorrect field type provided (for example, setting a `Boolean` field to `"Hello, I like cheese and gold!"`) -| **Property** | **Description** | -| :----------- | :-------------------------------------------------------- | -| `message` | Error message. | +| **Property** | **Description** | +| :----------- | :-------------- | +| `message` | Error message. | ## Error codes @@ -295,6 +295,10 @@ Possible errors: "Multiple errors occurred on the database during query execution: {errors}" +#### P2030 + +"Cannot find a fulltext index to use for the search, try adding a @@fulltext([Fields...]) to your schema" + ### Prisma Migrate (Migration Engine) #### P3000