Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/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
Indexing Lucene IndexWriter.Close()与IndexWriter.Commit()的比较_Indexing_Full Text Search_Lucene.net_Indexwriter_Bigdata - Fatal编程技术网

Indexing Lucene IndexWriter.Close()与IndexWriter.Commit()的比较

Indexing Lucene IndexWriter.Close()与IndexWriter.Commit()的比较,indexing,full-text-search,lucene.net,indexwriter,bigdata,Indexing,Full Text Search,Lucene.net,Indexwriter,Bigdata,当我只有一个IndexWriter的实例时,IndexWriter.Close()和IndexWriter.Commit()之间有什么不同 注意:我要建立索引的数据非常大,因此无法关闭IndexWriter运行时 注意:当数据在同一时间索引时,我想在文档中搜索。提交()提交对索引的挂起、缓冲的更改(然后可以使用IndexReader()找到)。然后可以继续使用IndexWriter进行更多更改。Close()还执行Commit(),但另外关闭IndexWriter。请注意,IndexWriter

当我只有一个
IndexWriter
的实例时,
IndexWriter.Close()
IndexWriter.Commit()
之间有什么不同

注意:我要建立索引的数据非常大,因此无法关闭IndexWriter运行时

注意:当数据在同一时间索引时,我想在文档中搜索。

提交()提交对索引的挂起、缓冲的更改(然后可以使用IndexReader()找到)。然后可以继续使用IndexWriter进行更多更改。Close()还执行Commit(),但另外关闭IndexWriter。请注意,IndexWriter实现IDisposable(),我建议使用它

对于第一个注释,如果您的意思是有很多文档需要索引,那么这很好。您可以对许多文档使用相同的IndexWriter,而无需关闭它。只需使用()语句在同一个IndexWriter中循环浏览要索引的文档数量

关于第二个注释,在IndexReader()看到IndexWriter()更改之前,必须先执行commit()(或close())。您可以始终使用IndexReader()进行搜索,但它只能看到自上次IndexWriter.Commit()以来的索引

对于这些重要的细节,我推荐Lucene。这对我帮助很大。

Commit()提交对索引的挂起、缓冲更改(然后可以使用IndexReader()找到)。然后可以继续使用IndexWriter进行更多更改。Close()还执行Commit(),但另外关闭IndexWriter。请注意,IndexWriter实现IDisposable(),我建议使用它

对于第一个注释,如果您的意思是有很多文档需要索引,那么这很好。您可以对许多文档使用相同的IndexWriter,而无需关闭它。只需使用()语句在同一个IndexWriter中循环浏览要索引的文档数量

关于第二个注释,在IndexReader()看到IndexWriter()更改之前,必须先执行commit()(或close())。您可以始终使用IndexReader()进行搜索,但它只能看到自上次IndexWriter.Commit()以来的索引


对于这些重要的细节,我推荐Lucene。这对我帮助很大。

我的回答对你有用吗?你需要更多的信息吗?非常感谢。你的信息足够了。我很高兴听到这个消息。你熟悉接受答案吗?或者我的答案中有什么遗漏导致你不接受?我的答案对你有用吗?你需要更多的信息吗?非常感谢。你的信息足够了。我很高兴听到这个消息。你熟悉接受答案吗?或者我的回答中有什么遗漏导致你不接受吗?+1推荐《Lucene在行动》一书。我发现它对理解Lucene.net非常有帮助。另外,我还推荐了一本书《Lucene在行动》。我发现它对理解Lucene.net非常有帮助。