Get your own customer support community
 

RandomAccessFile Question

Hey,

I'm having some trouble with the RandomAccessFile.
I have already created my Terms.Offset and Postings.Data and now I'm trying to get the cosine scoring to work.
I'm trying to fetch the postings list from the Postings.Data file for the term. I've got something like:

String currentTerm = "Jordan";
int postingOffset = TermsOffsetTable.get(currentTerm);
postings.seek(postingOffset);
int numOfDocs = postings.readInt();

Where TermsOffsetTable is a hashmap<string>, and it returns the correct offset value.

numOfDocs is returning an outrageous number, like 825505077, when it should actually be returning 145583 (I have a very small test file, and can look directly at the data).

I tried numerous RandomAccessFile methods, but not return the correct answer.

Other info:
Terms.Offset and Postings.Data are on 1 line (a very long line). is this going to be a problem?

thanks.
Inappropriate?
1 person has this question

User_default_medium