lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karl wettin <ka...@snigel.net>
Subject problems calculating norms
Date Thu, 11 May 2006 15:43:30 GMT
The my norm values does not equal the one of the norms set for the same
document and field in a Directory. I don't know why. They only differ
very little, but enough to change the order of very similar hits.

I only add one value to the field, so there is no mean division and
things going on in my code. Could that be it?

This is what I do:

if(eField.getKey().isIndexed && !eField.getKey().omitNorms) {
  float boost = eDocument.getKey().getBoost();
  boost *= eField.getKey().boost;
  float norm = eField.getKey().boost *
similarity.lengthNorm(eField.getKey().fieldName,
eField.getValue().size());
  byte encoded = Similarity.encodeNorm(norm);

boostByFieldNameAndDocumentNumber.get(eField.getKey().fieldName)[eDocument.getKey().getDocumentNumber()]
= encoded;
}


Any ideas?


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