This is what I have as scoring calculation, and it seems to do exactly what lucene-1.4.3 does because the tests pass.

public byte[] norms(String fieldName) {
if (DEBUG) System.err.println("MemoryIndexReader.norms: " + fieldName);
Info info = getInfo(fieldName);
int numTokens = info != null ? info.numTokens : 0;
byte norm = Similarity.encodeNorm(getSimilarity().lengthNorm(fieldName, numTokens));
return new byte[] {norm};
}

public void norms(String fieldName, byte[] bytes, int offset) {
if (DEBUG) System.err.println("MemoryIndexReader.norms: " + fieldName + "*");
byte[] norms = norms(fieldName);
System.arraycopy(norms, 0, bytes, offset, norms.length);
}


private Similarity getSimilarity() {
return searcher.getSimilarity(); // this is the normal lucene IndexSearcher
}


Can anyone see what's wrong with it for lucene current SVN? Should my calculation now be done differently? If so, how?
Thanks for any clues into the right direction.
Wolfgang.


On May 2, 2005, at 9:05 AM, Wolfgang Hoschek wrote:

I'm looking at it right now. The tests pass fine when you put lucene-1.4.3.jar instead of the current lucene onto the classpath which is what I've been doing so far. Something seems to have changed in the scoring calculation. No idea what that might be. I'll see if I can find out.

Wolfgang.

The test case is failing (type "ant test" at the contrib/memory working directory) with this:

[junit] Testcase: testMany(org.apache.lucene.index.memory.MemoryIndexTest): Caused an ERROR
[junit] BUG DETECTED:69 at query=term AND NOT phrase term, file=src/java/org/apache/lucene/index/memory/MemoryIndex.java, [EMAIL PROTECTED]
[junit] java.lang.IllegalStateException: BUG DETECTED:69 at query=term AND NOT phrase term, file=src/java/org/apache/lucene/index/memory/MemoryIndex.java, [EMAIL PROTECTED]
[junit] at org.apache.lucene.index.memory.MemoryIndexTest.run(MemoryIndexTest.jav a:305)
[junit] at org.apache.lucene.index.memory.MemoryIndexTest.testMany(MemoryIndexTes t.java:228)




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to