Skip to content

"simple" textSearch config not working as expected #616

@Tsunetsuki

Description

@Tsunetsuki

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

With textSearch, I cannot find a way to search for stopwords like and or the. This is expected when using the default english text config since this will filter stopwords, but when using the simple textSearch config the behaviour should be to get search results for any words entered.

To Reproduce

For a given table tbl with a text column col:

const textSearchText = "and";
const { data } = await supabase
  .from(tbl)
  .select()
  .textSearch(col, textSearchText, {
    type: "websearch",
    config: "simple",
  });

Expected behavior

Get rows where col contains the string "and".

Actual behavior

No results.

System information

  • OS: [Android (React Native)]
  • Version of supabase-js: [2.39.3]
  • Version of Node.js: [22.1.0]

Additional context

I would expect the above code to yield the same results as this SQL:

SELECT *
FROM tbl
WHERE to_tsvector('simple', col) @@ to_tsquery('simple', 'and');

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpostgrest-patch-neededRequires a change on PostgREST

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions