【问题标题】:How can I find an IndexSet's path in Examine?如何在检查中找到 IndexSet 的路径?
【发布时间】:2011-08-17 13:38:56
【问题描述】:

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

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

【问题讨论】:

    标签: c# lucene umbraco examine


    【解决方案1】:

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

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

    希望这对某人有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-27
      • 2021-10-10
      • 2017-05-18
      • 1970-01-01
      • 1970-01-01
      • 2015-03-07
      • 2018-02-02
      • 2011-04-24
      相关资源
      最近更新 更多