From 982a8119cd472375476e8f0c380ee7559554ff04 Mon Sep 17 00:00:00 2001 From: leemhoon00 Date: Wed, 17 Jan 2024 12:33:38 +0900 Subject: [PATCH 1/2] fix: mysql's fulltext search --- .../200-prisma-client/100-queries/060-full-text-search.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/200-orm/200-prisma-client/100-queries/060-full-text-search.mdx b/content/200-orm/200-prisma-client/100-queries/060-full-text-search.mdx index 7e622911d7..7fd7ba87d9 100644 --- a/content/200-orm/200-prisma-client/100-queries/060-full-text-search.mdx +++ b/content/200-orm/200-prisma-client/100-queries/060-full-text-search.mdx @@ -145,14 +145,16 @@ Here's how the following queries would match that text: | `+fox +dog` | Yes | The text contains 'fox' and 'dog' | | `+dog +fox` | Yes | The text contains 'dog' and 'fox' | | `+dog -cat` | Yes | The text contains 'dog' but not 'cat' | -| `-cat` | Yes | 'cat' is not in the text | +| `-cat` | No | The minus operator cannot be used on its own | | `fox dog` | Yes | The text contains 'fox' or 'dog' | -| `-cat -pig` | No | The text does not contain 'cat' or 'pig' | +| `-cat -pig` | No | The minus operator cannot be used on its own | | `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' | +> **Note**: The - operator acts only to exclude rows that are otherwise matched by other search terms. Thus, a boolean-mode search that contains only terms preceded by - returns an empty result. It does not return “all rows except those containing any of the excluded terms.” + 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"** From deb6892f4c26acbe54cfc050c593dfb3404df600 Mon Sep 17 00:00:00 2001 From: Jon Harrell <4829245+jharrell@users.noreply.github.com> Date: Thu, 18 Apr 2024 12:21:16 +0200 Subject: [PATCH 2/2] Apply suggestions from code review --- .../200-prisma-client/100-queries/060-full-text-search.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/200-orm/200-prisma-client/100-queries/060-full-text-search.mdx b/content/200-orm/200-prisma-client/100-queries/060-full-text-search.mdx index fd425659df..4b98326b22 100644 --- a/content/200-orm/200-prisma-client/100-queries/060-full-text-search.mdx +++ b/content/200-orm/200-prisma-client/100-queries/060-full-text-search.mdx @@ -148,9 +148,8 @@ Here's how the following queries would match that text: | `+fox +dog` | Yes | The text contains 'fox' and 'dog' | | `+dog +fox` | Yes | The text contains 'dog' and 'fox' | | `+dog -cat` | Yes | The text contains 'dog' but not 'cat' | -| `-cat` | No | The minus operator cannot be used on its own | +| `-cat` | No | The minus operator cannot be used on its own (see note below) | | `fox dog` | Yes | The text contains 'fox' or 'dog' | -| `-cat -pig` | No | The minus operator cannot be used on its own | | `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' |