-
Notifications
You must be signed in to change notification settings - Fork 113
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
Updates search text field to keyword subfield for policies and managed indices #267
Conversation
…ying managed indices and policies Signed-off-by: Drew Baugher <[email protected]>
"total_managed_indices" to 4 | ||
) | ||
// These should match all non datastream managed indices | ||
assertResponseMap(expected, getExplainMap(indexName = null, queryParams = "queryString=$testIndexName*")) |
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.
nit: hardening test a little bit, a case with two space separated tokens so we are covering AND condition we are enforcing always
Discussed with Ravi offline, if someone was taking advantage of the negation part of the query string, such as return me all managed indices that do not have the token -foobar in the name, then this would break that as the new behavior would be return me all managed indices that do not have an index name of foobar (as it's exact now). That being said... I don't think this is a behavior we ever went out to support, so it's more akin to a bug becoming a feature if someone did use it this way. The original intent was always just a simple query string that lets you search up index names and use a glob * pattern to match any number of characters. We plan to introduce this currently in the 2.0 version. |
Signed-off-by: Ravi <[email protected]>
Signed-off-by: Ravi <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #267 +/- ##
============================================
+ Coverage 76.60% 76.79% +0.18%
+ Complexity 2050 2049 -1
============================================
Files 253 253
Lines 11642 11642
Branches 1808 1808
============================================
+ Hits 8918 8940 +22
+ Misses 1753 1734 -19
+ Partials 971 968 -3
Continue to review full report at Codecov.
|
…d indices (opensearch-project#267) * Use the keyword subfield instead of the tokenized text field for querying managed indices and policies Signed-off-by: Drew Baugher <[email protected]> * Changing the job scheduler distribution path Signed-off-by: Ravi <[email protected]>
Issue #, if available:
opensearch-project/index-management-dashboards-plugin#117
opensearch-project/index-management-dashboards-plugin#119
opensearch-project/index-management-dashboards-plugin#112
Description of changes:
The mappings for the managed index and policy name/id fields were going through the standard analyzer which meant an index or policy with a name like "foo-bar-baz" would be broken up into tokens: ["foo", "bar", "baz"] and there would be no more hyphen. That combined with our use of the query string query which would also incorrectly use a hyphen as a negation (sometimes) and other unwanted behavior with wildcards being prepended/appended would cause searches on the UI to return empty results. e.g. searching "foo-*" would not return "foo-bar-baz".
So instead we'll query the keyword which should have stayed the same, added test cases to make sure hyphens and periods at least are working as we expect them to, and all other tests were passing so hoping no unknown regressions..
Tested on the UI with no changes and searches are working as expected now when the search bar includes hyphens or periods for datastreams.
CheckList:
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.