Skip to content

fix: Compatible with special characters in pg full-text search. - #8921

Merged
JohnJyong merged 1 commit into
langgenius:mainfrom
ThreeFish-AI:main
Sep 30, 2024
Merged

fix: Compatible with special characters in pg full-text search.#8921
JohnJyong merged 1 commit into
langgenius:mainfrom
ThreeFish-AI:main

Conversation

@ThreeFish-AI

@ThreeFish-AI ThreeFish-AI commented Sep 30, 2024

Copy link
Copy Markdown
Contributor

Checklist:

Important

Please review the checklist below before submitting your pull request.

  • Please open an issue before creating a PR or link to an existing issue
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Description

In hybrid search, when you do a full-text search with keywords in PG, if there are special characters in the keywords, such as single quotes, an exception will be thrown: syntax error in tsquery: "What's your password policies?"

image

Fixes #8920

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, included: Dify Document
  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • Dependency upgrade

Testing Instructions

test case: "What's your password policies?"

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐞 bug Something isn't working labels Sep 30, 2024
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Sep 30, 2024
@JohnJyong
JohnJyong merged commit 4585cff into langgenius:main Sep 30, 2024
cuiks pushed a commit to cuiks/dify that referenced this pull request Oct 8, 2024
lau-td pushed a commit to heydevs-io/dify that referenced this pull request Oct 23, 2024
idonotknow pushed a commit to AceDataCloud/Dify that referenced this pull request Nov 16, 2024
Ssazurov pushed a commit to Ssazurov/dify that referenced this pull request Aug 8, 2026
…genius#8921)

Co-authored-by: Aurelius Huang <cm.huang@aftership.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PG to_tsquery Exception:syntax error in tsquery: "What's your password policies?"

2 participants