From a3d255e16d0e8d852bbea25c4f904e9c437e8386 Mon Sep 17 00:00:00 2001 From: Suchit Sahoo <38322563+LDrago27@users.noreply.github.com> Date: Thu, 9 May 2024 17:16:32 -0700 Subject: [PATCH] Make Field Name Search Filter Case Insensitive (#6759) * Make Field Name Filter Case Insensitive Signed-off-by: Suchit Sahoo * Changeset file for PR #6759 created/updated --------- Signed-off-by: Suchit Sahoo Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> --- changelogs/fragments/6759.yml | 2 ++ .../public/application/components/sidebar/lib/field_filter.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/6759.yml diff --git a/changelogs/fragments/6759.yml b/changelogs/fragments/6759.yml new file mode 100644 index 000000000000..ef7e5cddddda --- /dev/null +++ b/changelogs/fragments/6759.yml @@ -0,0 +1,2 @@ +feat: +- Make Field Name Search Filter Case Insensitive ([#6759](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6759)) \ No newline at end of file diff --git a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts b/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts index d72af29b43e0..599e546058d2 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts +++ b/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts @@ -83,7 +83,8 @@ export function isFieldFiltered( field.type === '_source' || field.scripted || fieldCounts[field.name] > 0; - const matchName = !filterState.name || field.name.indexOf(filterState.name) !== -1; + const matchName = + !filterState.name || field.name.toLowerCase().indexOf(filterState.name.toLowerCase()) !== -1; // case insensitive matching name return matchFilter && isAggregatable && isSearchable && scriptedOrMissing && matchName; }