lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Rutherglen (JIRA)" <>
Subject [jira] Commented: (LUCENE-1312) InstantiatedIndexReader does not implement getFieldNames properly
Date Wed, 25 Jun 2008 01:30:45 GMT


Jason Rutherglen commented on LUCENE-1312:

In order to simulate a different IndexReader per update using InstantiatedIndexReader  I wrote
the following code.  There must be some flaws in it as it keeps on causing errors in SegmentMerger.
 I am overriding deleted docs and max doc.  Also the latest error, which I am sure is probably
somehow fixable.

public class OceanInstantiatedIndexReader extends InstantiatedIndexReader {
  private int maxDoc;
  private Set<Integer> deletedDocs;
  public OceanInstantiatedIndexReader(int maxDoc, InstantiatedIndex index, Set<Integer>
deletedDocs) {
    this.maxDoc = maxDoc;
    this.deletedDocs = deletedDocs;
  public int maxDoc() {
    return maxDoc;
  public int numDocs() {
    return maxDoc() - deletedDocs.size();
  public boolean isDeleted(int n) {
    if (n >= maxDoc) return true;
    if (deletedDocs != null && deletedDocs.contains(n)) return true;
    return false;
  public boolean hasDeletions() {
    return true;

at java.lang.System.arraycopy(Native Method)
at org.apache.lucene.index.SegmentMerger.mergeNorms(
at org.apache.lucene.index.SegmentMerger.merge(
at org.apache.lucene.index.SegmentMerger.merge(
at org.apache.lucene.index.IndexWriter.addIndexes(

> InstantiatedIndexReader does not implement getFieldNames properly
> -----------------------------------------------------------------
>                 Key: LUCENE-1312
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>            Reporter: Jason Rutherglen
>            Assignee: Karl Wettin
>         Attachments: lucene-1312.patch, lucene-1312.patch, lucene-1312.patch, lucene-1312.patch,
> Causes error in org.apache.lucene.index.SegmentMerger.mergeFields

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message