-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Categorize search queries by type and log query shape #10724
Categorize search queries by type and log query shape #10724
Conversation
Compatibility status:Checks if related components are compatible with change b172450 Incompatible componentsSkipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/neural-search.git] |
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
Signed-off-by: Michael Froh <[email protected]>
Signed-off-by: Siddhant Deshmukh <[email protected]>
f3194f1
to
b172450
Compare
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #10724 +/- ##
============================================
- Coverage 71.11% 71.04% -0.07%
+ Complexity 58530 58484 -46
============================================
Files 4854 4858 +4
Lines 276049 276178 +129
Branches 40168 40184 +16
============================================
- Hits 196311 196221 -90
- Misses 63385 63532 +147
- Partials 16353 16425 +72
|
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-10724-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 781968b2e53f3214b73d4d8e7c1baa572b334f27
# Push it to GitHub
git push --set-upstream origin backport/backport-10724-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x Then, create a pull request where the |
…ject#10724) * Search Query Categorizor initial skeleton using QueryBuilderVisitor Signed-off-by: Siddhant Deshmukh <[email protected]> * Integrate metrics framework, add counters and log query shape Signed-off-by: Siddhant Deshmukh <[email protected]> * Update changelog Signed-off-by: Siddhant Deshmukh <[email protected]> * Add level attribute to QueryBuilderVisitor and as a tag in Counters Signed-off-by: Siddhant Deshmukh <[email protected]> * Log query shape as debug log Signed-off-by: Siddhant Deshmukh <[email protected]> * Integrate metrics framework, refactor code and update tests Signed-off-by: Siddhant Deshmukh <[email protected]> * Fix build Signed-off-by: Siddhant Deshmukh <[email protected]> * Add javadocs Signed-off-by: Siddhant Deshmukh <[email protected]> * Minor fix Signed-off-by: Siddhant Deshmukh <[email protected]> * Spotless check changes Signed-off-by: Siddhant Deshmukh <[email protected]> * Address comments, add agg and sort counters, add feature flag, refactoring Signed-off-by: Siddhant Deshmukh <[email protected]> * Build fix Signed-off-by: Siddhant Deshmukh <[email protected]> * spotless check Signed-off-by: Siddhant Deshmukh <[email protected]> * Fix tests Signed-off-by: Siddhant Deshmukh <[email protected]> * Dynamic feature flag with callback Signed-off-by: Siddhant Deshmukh <[email protected]> * Minor fix Signed-off-by: Siddhant Deshmukh <[email protected]> * Add initialization in callback Signed-off-by: Siddhant Deshmukh <[email protected]> * Address comments Signed-off-by: Siddhant Deshmukh <[email protected]> * Add exception handling Signed-off-by: Siddhant Deshmukh <[email protected]> * Refactoring and renaming Signed-off-by: Siddhant Deshmukh <[email protected]> * Minor fix Signed-off-by: Siddhant Deshmukh <[email protected]> * Fix changelog and minor refactoring Signed-off-by: Siddhant Deshmukh <[email protected]> * Address review comments Signed-off-by: Siddhant Deshmukh <[email protected]> * Add unit tests Signed-off-by: Siddhant Deshmukh <[email protected]> * Address review comments and add complex query unit test Signed-off-by: Siddhant Deshmukh <[email protected]> * Add sort order as a tag to sort counter Signed-off-by: Siddhant Deshmukh <[email protected]> * Address review comments Signed-off-by: Siddhant Deshmukh <[email protected]> * Address final comments Signed-off-by: Siddhant Deshmukh <[email protected]> * Build fix Signed-off-by: Siddhant Deshmukh <[email protected]> * Fix build tests failure Signed-off-by: Siddhant Deshmukh <[email protected]> * Minor fix Signed-off-by: Siddhant Deshmukh <[email protected]> * Minor fix Signed-off-by: Siddhant Deshmukh <[email protected]> * Empty commit Signed-off-by: Siddhant Deshmukh <[email protected]> * Remove extra newline Signed-off-by: Michael Froh <[email protected]> * Empty commit Signed-off-by: Siddhant Deshmukh <[email protected]> --------- Signed-off-by: Siddhant Deshmukh <[email protected]> Signed-off-by: Michael Froh <[email protected]> Co-authored-by: Michael Froh <[email protected]>
…ject#10724) * Search Query Categorizor initial skeleton using QueryBuilderVisitor Signed-off-by: Siddhant Deshmukh <[email protected]> * Integrate metrics framework, add counters and log query shape Signed-off-by: Siddhant Deshmukh <[email protected]> * Update changelog Signed-off-by: Siddhant Deshmukh <[email protected]> * Add level attribute to QueryBuilderVisitor and as a tag in Counters Signed-off-by: Siddhant Deshmukh <[email protected]> * Log query shape as debug log Signed-off-by: Siddhant Deshmukh <[email protected]> * Integrate metrics framework, refactor code and update tests Signed-off-by: Siddhant Deshmukh <[email protected]> * Fix build Signed-off-by: Siddhant Deshmukh <[email protected]> * Add javadocs Signed-off-by: Siddhant Deshmukh <[email protected]> * Minor fix Signed-off-by: Siddhant Deshmukh <[email protected]> * Spotless check changes Signed-off-by: Siddhant Deshmukh <[email protected]> * Address comments, add agg and sort counters, add feature flag, refactoring Signed-off-by: Siddhant Deshmukh <[email protected]> * Build fix Signed-off-by: Siddhant Deshmukh <[email protected]> * spotless check Signed-off-by: Siddhant Deshmukh <[email protected]> * Fix tests Signed-off-by: Siddhant Deshmukh <[email protected]> * Dynamic feature flag with callback Signed-off-by: Siddhant Deshmukh <[email protected]> * Minor fix Signed-off-by: Siddhant Deshmukh <[email protected]> * Add initialization in callback Signed-off-by: Siddhant Deshmukh <[email protected]> * Address comments Signed-off-by: Siddhant Deshmukh <[email protected]> * Add exception handling Signed-off-by: Siddhant Deshmukh <[email protected]> * Refactoring and renaming Signed-off-by: Siddhant Deshmukh <[email protected]> * Minor fix Signed-off-by: Siddhant Deshmukh <[email protected]> * Fix changelog and minor refactoring Signed-off-by: Siddhant Deshmukh <[email protected]> * Address review comments Signed-off-by: Siddhant Deshmukh <[email protected]> * Add unit tests Signed-off-by: Siddhant Deshmukh <[email protected]> * Address review comments and add complex query unit test Signed-off-by: Siddhant Deshmukh <[email protected]> * Add sort order as a tag to sort counter Signed-off-by: Siddhant Deshmukh <[email protected]> * Address review comments Signed-off-by: Siddhant Deshmukh <[email protected]> * Address final comments Signed-off-by: Siddhant Deshmukh <[email protected]> * Build fix Signed-off-by: Siddhant Deshmukh <[email protected]> * Fix build tests failure Signed-off-by: Siddhant Deshmukh <[email protected]> * Minor fix Signed-off-by: Siddhant Deshmukh <[email protected]> * Minor fix Signed-off-by: Siddhant Deshmukh <[email protected]> * Empty commit Signed-off-by: Siddhant Deshmukh <[email protected]> * Remove extra newline Signed-off-by: Michael Froh <[email protected]> * Empty commit Signed-off-by: Siddhant Deshmukh <[email protected]> --------- Signed-off-by: Siddhant Deshmukh <[email protected]> Signed-off-by: Michael Froh <[email protected]> Co-authored-by: Michael Froh <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Description
Changes to categorize search queries based on the type of the query (eg: bool, match, multi-match, etc).
Changes also log the query shape of a query (queries can have a nested structure with a hierarchy of subqueries).
Use QueryShapeVisitor to debug log the shape of the queries. Example
Use QueryBuilderVisitor to visit all the nodes of the querybuilder tree for incoming search queries and increment counters to capture query type information
Integrate with #10241 for the counters
Related Issues
Resolves #10250
Check List
New functionality includes testing.
All tests pass
New functionality has been documented.
New functionality has javadoc added
Commits are signed per the DCO using --signoff
Commit changes are listed out in CHANGELOG.md file (See: Changelog)
Public documentation issue/PR created
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Previous PR with comments : #10502