C# 如何找到索引集';检查中的路径?

C# 如何找到索引集';检查中的路径?,c#,lucene,umbraco,examine,C#,Lucene,Umbraco,Examine,在我的Umbraco项目中,我在配置文件中定义了多个检查索引集。如何以编程方式检索单个索引集的路径 我知道检查.LuceneEngine.Config.IndexSetCollection,但我似乎无法获得此对象的填充实例。我自己找到了答案,因此我想我会分享它: IndexSetCollection sets = Examine.LuceneEngine.Config.IndexSets.Instance.Sets; IndexSet set = sets["Set_Name"]; Direct

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


我知道
检查.LuceneEngine.Config.IndexSetCollection
,但我似乎无法获得此对象的填充实例。

我自己找到了答案,因此我想我会分享它:

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对象中集合目录的所有属性

希望这对别人有帮助