mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Create index command should not delete existing index
This commit is contained in:
@@ -47,8 +47,19 @@ namespace Orchard.Indexing.Commands {
|
|||||||
Context.Output.WriteLine(T("Invalid index name."));
|
Context.Output.WriteLine(T("Invalid index name."));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_indexManager.GetSearchIndexProvider().CreateIndex(index);
|
var indexProvider = _indexManager.GetSearchIndexProvider();
|
||||||
Context.Output.WriteLine(T("New index has been created successfully."));
|
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."));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user