From 6b50414cfbddd08c05048e4a228c9cb74a592852 Mon Sep 17 00:00:00 2001 From: Nicholas Mayne Date: Sun, 12 Oct 2014 14:55:44 +0100 Subject: [PATCH] making sure the ,Search matches Search - you might have 1 index then add another, but you dont want to reindex all your content if oyu havent selected it --- .../Modules/Orchard.Indexing/Settings/EditorEvents.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.Indexing/Settings/EditorEvents.cs b/src/Orchard.Web/Modules/Orchard.Indexing/Settings/EditorEvents.cs index cb3567cef..9fbf042a3 100644 --- a/src/Orchard.Web/Modules/Orchard.Indexing/Settings/EditorEvents.cs +++ b/src/Orchard.Web/Modules/Orchard.Indexing/Settings/EditorEvents.cs @@ -34,7 +34,7 @@ namespace Orchard.Indexing.Settings { builder.WithSetting("TypeIndexing.Indexes", model.Indexes); // create indexing tasks only if settings have changed - if (model.Indexes != previous.Indexes) { + if (Clean(model.Indexes) != Clean(previous.Indexes)) { // if a an index is added, all existing content items need to be re-indexed CreateIndexingTasks(); @@ -43,6 +43,13 @@ namespace Orchard.Indexing.Settings { yield return DefinitionTemplate(model); } + private string Clean(string value) { + if (string.IsNullOrEmpty(value)) + return value; + + return value.Trim(',', ' '); + } + /// /// Creates new indexing tasks to update the index document for these content items ///