From 09e329f6683ebeea9f42df089561a5ce76248b93 Mon Sep 17 00:00:00 2001
From: "Aaron (Qilong)" <173288704@qq.com>
Date: Thu, 26 Oct 2023 03:26:46 -0400
Subject: [PATCH] DYN-6364 Skip Lucene indexing process in UIless mode (#14523)
* skip Lucene indexing process in UIless mode
* Update comments
---
src/DynamoCore/Models/DynamoModel.cs | 4 ++--
src/DynamoCore/Utilities/LuceneSearchUtility.cs | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/DynamoCore/Models/DynamoModel.cs b/src/DynamoCore/Models/DynamoModel.cs
index c86919ee645..cc22c698eb8 100644
--- a/src/DynamoCore/Models/DynamoModel.cs
+++ b/src/DynamoCore/Models/DynamoModel.cs
@@ -160,8 +160,8 @@ internal LuceneSearchUtility LuceneUtility
///
/// Flag to indicate that there is no UI on this process, and things
- /// like the update manager and the analytics collection should be
- /// disabled.
+ /// like the node index process, update manager and the analytics collection
+ /// should be disabled.
///
public static bool IsHeadless { get; set; }
diff --git a/src/DynamoCore/Utilities/LuceneSearchUtility.cs b/src/DynamoCore/Utilities/LuceneSearchUtility.cs
index 94e8b518f79..78f3cd9221b 100644
--- a/src/DynamoCore/Utilities/LuceneSearchUtility.cs
+++ b/src/DynamoCore/Utilities/LuceneSearchUtility.cs
@@ -106,6 +106,8 @@ internal LuceneSearchUtility(DynamoModel model, LuceneStartConfig config)
///
internal void InitializeLuceneConfig()
{
+ if (DynamoModel.IsHeadless) return;
+
addedFields = new List();
DirectoryInfo luceneUserDataFolder;