lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wolfgang Hoschek <whosc...@lbl.gov>
Subject Re: [Performance] Streaming main memory indexing of single strings
Date Mon, 02 May 2005 16:41:45 GMT
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,  
>> anal=org.apache.lucene.analysis.SimpleAnalyzer@127b52
>>     [junit] java.lang.IllegalStateException: BUG DETECTED:69 at  
>> query=term AND NOT phrase term,  
>> file=src/java/org/apache/lucene/index/memory/MemoryIndex.java,  
>> anal=org.apache.lucene.analysis.SimpleAnalyzer@127b52
>>     [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: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org


---------------------------------------------------------------------
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