问题
as I've read the documentation of the lucene 4.0, now this library stores some statistics as in order to compute different scoring models, one of them bm25. Is there a way, besides fetching a document, to fetch its length too?
回答1:
You can store whatever you want from FieldInvertState into the 'norm', and it doesn't have to be a 8 bit float either.
The default is a lossy storage of the length, if you want the actual exact length, maybe you choose to use a short (16bits) per document or something else instead.
See Similarity.computeNorm
来源:https://stackoverflow.com/questions/9636641/document-length-in-lucene-4-0