Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-5843

IndexWriter should refuse to create an index with more than INT_MAX docs

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.9.1, 4.10, 6.0
    • core/index
    • None
    • New

    Description

      It's more and more common for users these days to create very large indices, e.g. indexing lines from log files, or packets on a network, etc., and it's not hard to accidentally exceed the maximum number of documents in one index.

      I think the limit is actually Integer.MAX_VALUE-1 docs, because we use that value as a sentinel during searching.

      I'm not sure what IW does today if you create a too-big index but it's probably horrible; it may succeed and then at search time you hit nasty exceptions when we overflow int.

      I think it should throw an IndexFullException instead. It'd be nice if we could do this on the very doc that when added would go over the limit, but I would also settle for just throwing at flush as well ... i.e. I think what's really important is that the index does not become unusable.

      Attachments

        1. LUCENE-5843.patch
          23 kB
          Michael McCandless
        2. LUCENE-5843.patch
          29 kB
          Michael McCandless
        3. LUCENE-5843.patch
          31 kB
          Michael McCandless
        4. LUCENE-5843.patch
          30 kB
          Michael McCandless

        Issue Links

          Activity

            People

              mikemccand Michael McCandless
              mikemccand Michael McCandless
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: