drizzle-orm icon indicating copy to clipboard operation
drizzle-orm copied to clipboard

[MySql] Add support for `fulltext` search with MATCH AGAINST function

Open Angelelz opened this issue 2 years ago • 14 comments

This PR aims to complete the implementation started in this PR.

  • Added a new fulltextIndex function for the creation of fulltext index.
  • Added a new match function that returns a class with an against method to be able to use the builder pattern as requested in this comment
  • Added a configuration option to be able to use all the modes of the fulltext search.
  • Added corresponding tests.

The user should now be able to use it as follows:

select()
  .from(users)
  .where(
    match(users.name, users.bio)
      .against("drizzle*", {
        mode: "boolean"
      }));

Please note that the fulltextIndex function would address #1018 but won't do anything on it's own as it needs to be supported by Drizzle-kit when creating a migration.

Angelelz avatar Aug 12 '23 21:08 Angelelz

I will add drizzle-kit support for that and then merge this PR. Will keep you updated here

AndriiSherman avatar Aug 13 '23 21:08 AndriiSherman

I was trying to change the base branch for this PR but it's apparently not possible

Angelelz avatar Aug 24 '23 00:08 Angelelz

Would love to see this merged!

iSchoen avatar Sep 08 '23 22:09 iSchoen

Hi, anyone knows what's the status on this PR? Would love to use this feature on a planetscale db

frozenBranch avatar Oct 20 '23 19:10 frozenBranch

Are there plans on merging this pull request?

anatolzak avatar Nov 24 '23 04:11 anatolzak

Any updates on this? Currently having to use planetscale branching, and manually adding fulltext indexes through the planetscale console on every schema change that get's merged to production.

dane-stevens avatar Jan 22 '24 19:01 dane-stevens

Sadly this is a gamebreaker for me and I will need to move to different orm until this is merged...

Baterka avatar Jan 29 '24 22:01 Baterka

I'd also love to see this update merged.

nowlena avatar Feb 08 '24 20:02 nowlena

@AndriiSherman has support for this landed in drizzle-kit? You don't accept pull requests in your drizzle-kit-mirror repository right?

richardhristov avatar Apr 07 '24 16:04 richardhristov

Any news?

ThisIsRuddy avatar Oct 15 '24 12:10 ThisIsRuddy

plan anytime soon to merge this PR? I'd love to use this feature :)

moiguitarrock avatar Nov 13 '24 18:11 moiguitarrock

How about this ? @Angelelz

select()
  .from(users)
  .where(
    match(users.name, users.bio)
-      .against("drizzle*", {
-        mode: "boolean"
-      }));
+     .against("drizzle*", "boolean")
+ );

That would be closer to SQL syntax.

Maybe the variable naming should be more like in MySQL for example inBooleanMode.

select()
  .from(users)
  .where(
    match(users.name, users.bio)
-      .against("drizzle*", {
-        mode: "boolean"
-      }));
+     .against("drizzle*", "inBooleanMode")
+ );

or

select()
  .from(users)
  .where(
    match(users.name, users.bio)
-      .against("drizzle*", {
-        mode: "boolean"
-      }));
+     .against("drizzle*", "booleanMode")
+ );

pedro757 avatar Nov 29 '24 14:11 pedro757

+1

johaven avatar Dec 24 '24 08:12 johaven

+1

AlexisMunozC avatar Apr 18 '25 20:04 AlexisMunozC

Any progress here?

mdevils avatar May 13 '25 11:05 mdevils

+1

hendriknielaender avatar Sep 23 '25 13:09 hendriknielaender