Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Fulltext index for PostgreSQL #39875

Merged
merged 2 commits into from
Dec 7, 2021
Merged

[8.x] Fulltext index for PostgreSQL #39875

merged 2 commits into from
Dec 7, 2021

Conversation

tpetry
Copy link
Contributor

@tpetry tpetry commented Dec 2, 2021

As promised on Twitter, I want to help with the PostgreSQL support for fulltext search.

But as fulltext searching is no SQL standard, every database has an entirely different implementation. The most significant difference is that PostgreSQL fulltext searching is language-dependent because the stemming algorithms are always only designed for a specific language. Also, adding a fulltext index for multiple columns is different. The vectors for multiple columns need to be combined for the index creation. But when querying the database the exact same syntax for combining the vectors needs to be used for the query or the index will not be used. As there is no query builder method to build these conditions, I restricted the usage to a single column for the moment. With an official way to query the index the restriction could be lifted.

So the following changes had to be made:

  • An optional language parameter was added to Blueprint::fulltext()
  • The PostgreSQL driver will fail if no language was provided
  • The PostgreSQL driver will fail when trying to add a fulltext index with multiple columns

@GrahamCampbell GrahamCampbell changed the title Fulltext index for PostgreSQL [8.x] Fulltext index for PostgreSQL Dec 2, 2021
CHANGELOG-8.x.md Outdated Show resolved Hide resolved
@taylorotwell taylorotwell merged commit 8c1f6ce into laravel:8.x Dec 7, 2021
@tpetry tpetry deleted the postgresql-fulltext-index branch December 7, 2021 14:29
@otilor otilor mentioned this pull request Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants