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

fix err in keyword searching #494

Merged
merged 1 commit into from
Oct 9, 2022
Merged

fix err in keyword searching #494

merged 1 commit into from
Oct 9, 2022

Conversation

hulb
Copy link
Contributor

@hulb hulb commented Oct 9, 2022

fix #470 #477

@hulb hulb changed the title fix #477 fix err in keyword searching Oct 9, 2022
@@ -223,7 +223,9 @@ func (db *PGDatabase) GetBookmarks(ctx context.Context, opts GetBookmarksOptions
if opts.Keyword != "" {
query += ` AND (
url LIKE :lkw OR
MATCH(title, excerpt, content) AGAINST (:kw IN BOOLEAN MODE)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that MATCH ... AGAINST is a mysql syntax for text searching. In postgres, I don't find such simple way to implement text matching so I use LIKE multi times as a workround.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we need to implement FTS into PSQL, I need to take a look at #276 first in order to decide an engine.

@fmartingr
Copy link
Member

Hey @hulb, as always, thank you for fixing this! Little by little we're making Shiori more stable and usable :)

@fmartingr fmartingr merged commit 821b69d into go-shiori:master Oct 9, 2022
@hulb
Copy link
Contributor Author

hulb commented Oct 9, 2022

Hey @hulb, as always, thank you for fixing this! Little by little we're making Shiori more stable and usable :)

You're welcome.Glad to contribute :)

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.

Search error: failed to fetch count: pq: syntax error at or near "AGAINST" (500)
2 participants