Skip to content

Commit

Permalink
Fixed the problem with total doc count while reindexing
Browse files Browse the repository at this point in the history
SENSEI-145 totaldocs is wrong with cardemo
  • Loading branch information
vzhabiuk committed Jan 31, 2012
1 parent c2ea1b7 commit 9911f33
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions zoie-core/src/main/java/proj/zoie/api/ZoieSegmentReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ static final class UIDTokenStream extends TokenStream {
buffer[5] = (byte) (uid >> 40);
buffer[6] = (byte) (uid >> 48);
buffer[7] = (byte) (uid >> 56);
payloadAttr = (PayloadAttribute)addAttribute(PayloadAttribute.class);
payloadAttr = addAttribute(PayloadAttribute.class);
payloadAttr.setPayload(new Payload(buffer));
termAttr = (CharTermAttribute)addAttribute(CharTermAttribute.class);
termAttr = addAttribute(CharTermAttribute.class);
termAttr.append(termVal);
returnToken = true;
}
Expand Down Expand Up @@ -242,7 +242,7 @@ private void init(IndexReader reader) throws IOException

public static long bytesToLong(byte[] bytes){
return ((long)(bytes[7] & 0xFF) << 56) | ((long)(bytes[6] & 0xFF) << 48) | ((long)(bytes[5] & 0xFF) << 40) | ((long)(bytes[4] & 0xFF) << 32) | ((long)(bytes[3] & 0xFF) << 24) | ((long)(bytes[2] & 0xFF) << 16)
| ((long)(bytes[1] & 0xFF) << 8) | (long)(bytes[0] & 0xFF);
| ((long)(bytes[1] & 0xFF) << 8) | (bytes[0] & 0xFF);
}

@Override
Expand Down Expand Up @@ -339,7 +339,10 @@ protected void doClose() throws IOException {
public void decRef() throws IOException {
// not synchronized, since it doesn't do anything anyway
}

@Override
public int numDocs() {
return super.numDocs() - _currentDelDocIds.length;
}
/**
* makes exact shallow copy of a given ZoieMultiReader
* @param <R>
Expand Down

0 comments on commit 9911f33

Please sign in to comment.