-
Notifications
You must be signed in to change notification settings - Fork 212
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
Remove unused simple query string features #3360
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6f7a352
Remove unused simple query string features
obulat 6d0c6b5
Update the snapshots
obulat e8cb711
Update the tests
obulat c6f9a28
Add flags if present in query
obulat aef4c0a
Merge branch 'main' into remove-unused-sqs-features
obulat fe4b872
Merge branch 'main' into remove-unused-sqs-features
obulat 9e26dea
Stop adding conditional flags
obulat df7b525
Merge branch 'main' into remove-unused-sqs-features
obulat 24538ee
Improve logging
obulat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion, but it would produce less logs overall while making it easier to tally them if the logging did something like, counting the instances of each flag and logging all flags at once in JSON like
{ "log_message": "Special features present in query", "query_name": query_name, "query": query} | {flag: count_flag(flag, query) for flag in flags }
(one-liner just for commenting, not to suggest that's the way to do it).No big deal, though. This way works too, it just produces slightly more logs (not many, because we know these are used so rarely and mostly following the frontend examples) and requires parsing the message string rather than using Logs Insights discovered fields feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this suggestion, I was actually not certain that the logging pattern would be good, and I didn't even realize that there could be several flags used in a single search. I'll update the logging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the logging, now if you go to
http://0.0.0.0:50280/v1/images/?q=cat+net*+(dog)+%5C(+someth~2
, you get the following message logged:[2023-11-30 08:32:53,795 - root - 362][INFO] [3419191a256b4058b2e8ffd5066b1ec2] {'log_message': 'Special features present in query', 'query_name': 'q', 'query': 'cat net* (dog) \\( someth~2', 'flags': ['PRECEDENCE', 'ESCAPE', 'FUZZY|SLOP', 'PREFIX']}
I don't think we need to log the flag cound separately, do you, @sarayourfriend ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the raw count isn't that important, is it! Good call 👍 The change LGTM.