Details
Description
The CompressingMetaIndex stores items as aspected.
Problem: If you try to get an item (CompressingMetaIndex.getItem(String Key, int docid)) from the index, before it will be returned, the "trim()" method is called. That is a problem in case that the item contained leading/trailing spaces.
Problem: If you try to get an item (CompressingMetaIndex.getItem(String Key, int docid)) from the index, before it will be returned, the "trim()" method is called. That is a problem in case that the item contained leading/trailing spaces.
@Craig
Not sure what you meant; this is my code
final String docno = index.getMetaIndex().getItem("docno", 0);
System.err.format("docno[0] = [%s]%n", docno);
System.err.format("docid(%s) = %d%n", docno, index.getMetaIndex().getDocument("docno", docno));
The output is
docno[0] = [AP880212-0001]
docid(AP880212-0001) = -1
As a quick fix, in TRECCollection.java, line 394 I replaced
ThisDocID = DocumentIDContents.toString();
by
ThisDocID = DocumentIDContents.toString().trim();