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

Merged
merged 16 commits into from
Jul 22, 2024
Merged

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
srikanthccv
srikanthccv previously approved these changes Apr 2, 2024
pkg/query-service/app/logs/v3/query_builder.go Outdated Show resolved Hide resolved
@nityanandagohain
Copy link
Member Author

One other thing that this PR changes is that it uses like in favour of ilike, which means that attribute queries for contains and like won't be case independent now. I am not sure if we should remove it for this PR. cc @srikanthccv

@srikanthccv
Copy link
Member

Yes, that should have a separate issue for itself.

@nityanandagohain
Copy link
Member Author

Have made the changes, now it will only apply for body .

Attributes and resource attributes won't be touched.

@nityanandagohain nityanandagohain merged commit 1585065 into develop Jul 22, 2024
12 checks passed
@nityanandagohain nityanandagohain deleted the issue_4259 branch July 22, 2024 12:16
@@ -72,6 +73,7 @@ func getPath(keyArr []string) string {

func getJSONFilterKey(key v3.AttributeKey, op v3.FilterOperator, isArray bool) (string, error) {
keyArr := strings.Split(key.Key, ".")
// i.e it should be at least body.name, and not something like body
if len(keyArr) < 2 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this account for body. where there is just space after the . ?

Copy link
Member Author

Choose a reason for hiding this comment

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

keys dont contain space, it will be a invalid query

Copy link
Collaborator

Choose a reason for hiding this comment

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

it will be returned before reaching this point ?

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.
3 participants