Processing of Lucene index files larger than 2 GB

Source: Internet
Author: User
Is there a way to limit the size of an index?

This question is sometimes brought up because of the 2 GB file size limit of some 32-bit operating systems.

This is a slightly modified answer from Doug cutting:

The easiest thing is to useIndexwriter. setmaxmergedocs ().

If, for instance, you hit the 2 GB limit at 8 m quota ents setMaxmergedocsTo 7 m. That will keep Lucene from trying to merge an index that won't fit in your filesystem. It will actually adjust tively round this down to the next lower powerIndex. mergefactor.

So with the defaultMergefactorSet to 10 andMaxmergedocsSet to 7 m Lucene will generate a series of 1 m document indexes, since merging 10 of these wowould exceed the maximum.

A slightly more complex solution:

You cocould further minimize the number of segments if, when you 've added 7 m users ENTs, optimize the index and start a new index. Then useMultisearcherTo search the indexes.

An even more complex and optimal solution:

Write a versionFsdirectoryThat, when a file exceeds 2 GB, creates a subdirectory and represents the file as a series of files.

In Linux, you can use ulimit-F to change the maximum supported file size.
Multiple indexes can be retrieved at the same time.
The problem has been solved. You can access the index file in XP. Front-end display interface needs to be improved.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.