mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-31 21:41:40 +08:00
Create index command should not delete existing index
This commit is contained in:
parent
4cec35daf8
commit
79a0ae86e8
@ -47,8 +47,19 @@ namespace Orchard.Indexing.Commands {
|
||||
Context.Output.WriteLine(T("Invalid index name."));
|
||||
}
|
||||
else {
|
||||
_indexManager.GetSearchIndexProvider().CreateIndex(index);
|
||||
Context.Output.WriteLine(T("New index has been created successfully."));
|
||||
var indexProvider = _indexManager.GetSearchIndexProvider();
|
||||
if(indexProvider == null) {
|
||||
Context.Output.WriteLine(T("New indexing service was found. Please enable a module like Lucene."));
|
||||
}
|
||||
else {
|
||||
if (indexProvider.Exists(index)) {
|
||||
Context.Output.WriteLine(T("The specified index already exists."));
|
||||
}
|
||||
else {
|
||||
_indexManager.GetSearchIndexProvider().CreateIndex(index);
|
||||
Context.Output.WriteLine(T("New index has been created successfully."));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user