Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在多个word文档文件中搜索指定的单词_C#_Full Text Search_Search Engine - Fatal编程技术网

C# 在多个word文档文件中搜索指定的单词

C# 在多个word文档文件中搜索指定的单词,c#,full-text-search,search-engine,C#,Full Text Search,Search Engine,我有很多word和excel文件,我想在这些文件的内容中搜索指定的单词(用户将其作为我的应用程序的参数)。那我怎么做呢?我想用C#做这项工作,我能做吗 我的文件内容是波斯语。 事实上,我想用这些文件做一个搜索引擎 谢谢。使用Lucene引擎或实施您的SLEF 示例自(仅更改为“PersianAnalyzer”) 来这里是想说Lucene。Lucene让这变得非常简单。将您的所有文档转储到索引中,Lucene将执行硬工作Lucene是否支持波斯语文本?你能给我举个简单的例子吗?谢谢 Standar

我有很多word和excel文件,我想在这些文件的内容中搜索指定的单词(用户将其作为我的应用程序的参数)。那我怎么做呢?我想用C#做这项工作,我能做吗

我的文件内容是波斯语。

事实上,我想用这些文件做一个搜索引擎


谢谢。

使用Lucene引擎或实施您的SLEF

示例自(仅更改为“PersianAnalyzer”)


来这里是想说Lucene。Lucene让这变得非常简单。将您的所有文档转储到索引中,Lucene将执行硬工作Lucene是否支持波斯语文本?你能给我举个简单的例子吗?谢谢
StandardAnalyzer analyzer = new PersianAnalyzer(Version.LUCENE_40);
Directory index = new RAMDirectory();

IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_40, analyzer);

IndexWriter w = new IndexWriter(index, config);
addDoc(w, "Lucene in Action", "193398817");
addDoc(w, "Lucene for Dummies", "55320055Z");
addDoc(w, "Managing Gigabytes", "55063554A");
addDoc(w, "The Art of Computer Science", "9900333X");
w.close()