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

This commit is contained in:
Nicholas Mayne
2014-10-12 14:55:44 +01:00
parent 648eb5d8bf
commit 6b50414cfb

View File

@@ -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(',', ' ');
}
/// <summary>
/// Creates new indexing tasks to update the index document for these content items
/// </summary>