在我的Umbraco项目中,我在配置文件中定义了多个检查IndexSets。如何以编程方式检索单个IndexSet的路径?
我知道Examine.LuceneEngine.Config.IndexSetCollection,但似乎无法获得此对象的填充实例。
发布于 2011-08-17 22:32:01
我自己找到了答案,所以我想我应该分享一下:
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对象中获得了set的目录的所有属性。
希望这对某些人有帮助。
https://stackoverflow.com/questions/7093811
复制相似问题