一段计算机方面的英文

来源:百度知道 编辑:UC知道 时间:2024/05/21 19:39:49
Is there a way to limit the size of an index?
This question is sometimes brought up because of the 2GB file size limit of some 32-bit operating systems.

This is a slightly modified answer from Doug Cutting:

The easiest thing is to use IndexWriter.setMaxMergeDocs().

If, for instance, you hit the 2GB limit at 8M documents set maxMergeDocs to 7M. That will keep Lucene from trying to merge an index that won't fit in your filesystem. It will actually effectively round this down to the next lower power of Index.mergeFactor.

So with the default mergeFactor set to 10 and maxMergeDocs set to 7M Lucene will generate a series of 1M document indexes, since merging 10 of these would exceed the maximum.

A slightly more complex solution:

You could further minimize the number of segments if, when you've added 7M documents, optimize the index and start a new index. Then use MultiSearcher to search the indexes.

英语差,用google翻译了下,不是很准确,可以看个大概的意思

有没有一种办法来限制规模的一个指标? 这个问题,有时带来的,因为现在的2GB的文件大小限制,大约32位元作业系统. 这是一个稍微修改答案,从佛罗切割:最简单的就是用indexwriter.setmaxmergedocs ( ) . 举例来说,如果你击中了2GB的限制,在8m机文件maxmergedocs设定为641 . 这将Lucene的,从试图把一个指数,不适合在你的文件. 但实际上,这会有效回合下来的,下力index.mergefactor . 所以,在默认mergefactor定为10和maxmergedocs设为641 Lucene的会产生一系列的891 文件索引,因为合并了10颗将超过最大值. 一种略微更复杂的解决办法:你可以进一步减少环节,如果当您392,665.28补充文件, 优化指数,并开始一个新的指数. 然后使用multisearcher搜索索引. 一个更加复杂和最优解:写一版fsdirectory ,当一个文件超过2GB的, 创建一个子目录,并代表文件的一系列文件

关于32位系统下最大单个文件是2GB的问题吗?自己翻译吧,多查字典。

有没有一种办法来限制规模的一个指标? 这个问题,有时带来的,因为现在的2GB的文件大小限制,大约32位元作业系统. 这是一个稍微修改答案,从佛罗切割:最简单的就是用indexwriter.setmaxmergedocs ( ) . 举例来说,如果你击中了2GB的限制,在8m机文件maxmergedocs设定为641 . 这将Lucene的,从试图把一个指数,不适合在你的文件. 但实际上,这会有效回合下来的,下力index.mergefactor . 所以,在默认mergefactor定为10和maxmergedocs设为641 Lucene的会产生一系列的891 文件索引,因为合并了10颗将超过最大值. 一种略微更复杂的解决办法:你可以进一步减少环节,如果当您392,665.28补充文件, 优化指数,并开始一个新的指数. 然后使用multisearcher搜索索引. 一个更加复杂和最优解:写一版fsdirectory ,当一个文件超过2GB的, 创建一个子目录,并代表文件的一系列文件.