document length in lucene 4.0

空扰寡人 提交于 2020-01-11 13:33:11

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!