<div dir="ltr">You might want to look at how Lucene has implemented document length lookup for the BM25Similarity class (added in Lucene 4.0):<div><br></div><div><a href="http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/search/similarities/BM25Similarity.html">http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/search/similarities/BM25Similarity.html</a><br>

</div><div><br></div><div style>I assumed they're using a document payload for storing the lengths, but haven't looked into it.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 17 June 2013 14:28, jiangwen jiang <span dir="ltr"><<a href="mailto:jiangwen127@gmail.com" target="_blank">jiangwen127@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote><u><i>Or do you mean that it's one number per document whereas the other stats</i><br>

<i>are per database, so it's harder to store it?</i></u><div>
<br></div></div><div>yes, I mean this. It's a huge data. If a new doclength list(contains all the doclength in a list, like chert)</div><div>is added by myself, I am concern about:</div><div>1. This doclength list may be the bottlenect in this backend, <a href="http://trac.xapian.org/ticket/326" target="_blank">http://trac.xapian.org/ticket/326</a></div>


<div>2. Change too much above Lucene file format, then it's hard to compare performance between Xapian and Lucene</div><div><br></div><div>Some ideas:</div><div>1. Using rank algorithm without doclength, such as BM25Weight or TradWeight without doclength, or tfidfWeight.</div>


<div>    If ranking results will be not good without doclength?</div><div>2. Stores doclength in .prx payload when doing Lucene indexing. </div><div>    <a href="https://lucene.apache.org/core/3_6_0/api/all/org/apache/lucene/index/Payload.html" target="_blank">https://lucene.apache.org/core/3_6_0/api/all/org/apache/lucene/index/Payload.html</a></div>


<div>    <a href="http://searchhub.org/2009/08/05/getting-started-with-payloads/" target="_blank">http://searchhub.org/2009/08/05/getting-started-with-payloads/</a></div><div>    But this method has obvious drawback, it's not for general Lucene index data, if doclength is not stored, this method</div>


<div>    doesn't works</div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
</blockquote></div>Any suggestions?</div><div><br></div><div>Regards</div>
<br>_______________________________________________<br>
Xapian-devel mailing list<br>
<a href="mailto:Xapian-devel@lists.xapian.org">Xapian-devel@lists.xapian.org</a><br>
<a href="http://lists.xapian.org/mailman/listinfo/xapian-devel" target="_blank">http://lists.xapian.org/mailman/listinfo/xapian-devel</a><br>
<br></blockquote></div><br></div>