lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aditya Liviandi <>
Subject need help understanding the source...
Date Thu, 12 Jan 2006 10:31:37 GMT

Which class writes to the .frq?

I thought it's documentwriter, but the following code in the doesn't really do what fileformats says the .frq
file is like...

        int postingFreq = posting.freq;
        if (postingFreq == 1)				  // optimize
          freq.writeVInt(1);			  // set low bit of doc
        else {
          freq.writeVInt(0);			  // the document number
          freq.writeVInt(postingFreq);			  // frequency
in doc

the code in seems to do the right one...

        int freq = postings.freq();
        if (freq == 1) {
          freqOutput.writeVInt(docCode | 1);	  // write doc & freq=1
        } else {
          freqOutput.writeVInt(docCode);	  // write doc
          freqOutput.writeVInt(freq);		  // write frequency in

so then, what does the first portion (the one from
really do?

Why does it write 0 when postingFreq is more than one?

This email is confidential and may be privileged.  If you are not the intended recipient,
please delete it and notify us immediately. Please do not copy or use it for any purpose,
or disclose its contents to any other person. Thank you.

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

View raw message