1

在我的 Umbraco 项目中,我在配置文件中定义了多个检查索引集。如何以编程方式检索单个 IndexSet 的路径?

我知道Examine.LuceneEngine.Config.IndexSetCollection但我似乎无法获得该对象的填充实例。

4

1 回答 1

2

我自己找到了答案,所以我想我会分享它:

IndexSetCollection sets = Examine.LuceneEngine.Config.IndexSets.Instance.Sets;
IndexSet set = sets["Set_Name"];
DirectoryInfo dir = set.IndexDirectory;
string path = Path.Combine(dir.FullName, "Index");

显然,我也拥有来自 DirectoryInfo 对象的集合目录的所有属性。

希望这可以帮助某人。

于 2011-08-17T14:32:01.487 回答