lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aditya Liviandi <adit...@i2r.a-star.edu.sg>
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
documentwriter.java doesn't really do what fileformats says the .frq
file is like...

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

the code in segmentmerger.java 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
doc
        }

so then, what does the first portion (the one from documentwriter.java)
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message