From 1b583e4b54da8ba1a84a6797d3d6ce871e765b02 Mon Sep 17 00:00:00 2001 From: Spade A <71589810+SpadeA-Tang@users.noreply.github.com> Date: Wed, 3 Sep 2025 14:35:53 +0800 Subject: [PATCH] fix: fixing ngram index rejecting mmap (#44175) issue: https://github.com/milvus-io/milvus/issues/44164 Signed-off-by: SpadeA --- internal/util/indexparamcheck/index_type.go | 3 ++- internal/util/indexparamcheck/index_type_test.go | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/util/indexparamcheck/index_type.go b/internal/util/indexparamcheck/index_type.go index 3f0a5fa640..7ffd16052c 100644 --- a/internal/util/indexparamcheck/index_type.go +++ b/internal/util/indexparamcheck/index_type.go @@ -64,7 +64,8 @@ func IsScalarMmapIndex(indexType IndexType) bool { return indexType == IndexINVERTED || indexType == IndexBitmap || indexType == IndexHybrid || - indexType == IndexTrie + indexType == IndexTrie || + indexType == IndexNGRAM } func ValidateMmapIndexParams(indexType IndexType, indexParams map[string]string) error { diff --git a/internal/util/indexparamcheck/index_type_test.go b/internal/util/indexparamcheck/index_type_test.go index 5b744ed6b8..05a03aaf9e 100644 --- a/internal/util/indexparamcheck/index_type_test.go +++ b/internal/util/indexparamcheck/index_type_test.go @@ -65,4 +65,11 @@ func TestValidateMmapTypeParams(t *testing.T) { }) assert.Error(t, err) }) + + t.Run("stl_mmap mmap enable", func(t *testing.T) { + err := ValidateMmapIndexParams(IndexNGRAM, map[string]string{ + common.MmapEnabledKey: "true", + }) + assert.NoError(t, err) + }) }