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: use proper indexes for full text search #4787

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

nityanandagohain
Copy link
Member

@nityanandagohain nityanandagohain commented Apr 1, 2024

Fixes #4259

changes

  • body searches use lower(body) now.
  • attributes search with operator contains will also use lower(attribute) now but there is no change for them.
  • json search add's new filters i.e where clauses.

@github-actions github-actions bot added the bug Something isn't working label Apr 1, 2024

// for use lower for like and ilike
if op == v3.FilterOperatorLike || op == v3.FilterOperatorNotLike {
columnName = fmt.Sprintf("lower(%s)", columnName)
Copy link
Member

Choose a reason for hiding this comment

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

Can you share some examples with and without lower on mixed case data? The way I imagined this would work is that we need to make the index lower and convert the search value to lower but do not use the lower function. Just to double check we will not run into this kind of problem https://stackoverflow.com/questions/62629579/mysql-why-using-where-on-date-column-does-not-use-index

Copy link
Member Author

Choose a reason for hiding this comment

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

This is tested , using lower(body) in the where clause uses the corresponding lower(body) index
#4259 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

Can I play with this somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

please check slack


// for use lower for like and ilike
if op == v3.FilterOperatorLike || op == v3.FilterOperatorNotLike {
columnName = fmt.Sprintf("lower(%s)", columnName)
Copy link
Member

Choose a reason for hiding this comment

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

Can I play with this somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[LOGS] Index on body is not working.
2 participants