2012-04-08 40 views
0

有没有一种方法可以在Orchard中配置lucene.net以在Orchard根目录下的目录中搜索单词文档的内容。有没有办法让它索引另一个网站。在单词文档和其他网站中搜索

+0

Lucene.Net既不是*内容分析工具*,也不是*网络爬虫*。以某种方式获取文本*并使用Lucene.Net对其进行索引 – 2012-04-08 20:12:17

回答

0

如果您可以以某种方式将内容添加为Orchard中的内容项,则可以在ContentHandler内使用OnIndexing方法的技巧。

像这样的东西应该这样做:

public class WordDocumentContentHandler: ContentHandler { 
    public WordDocumentContentHandler() { 
     OnIndexing<ContentPart>((context, part) => { 
      // Detect if the part has the field containing the URL to the document 
      // and analyze it here. 
     }); 
    } 
}