<bdo id='fjPcH'></bdo><ul id='fjPcH'></ul>
  1. <tfoot id='fjPcH'></tfoot>

    1. <legend id='fjPcH'><style id='fjPcH'><dir id='fjPcH'><q id='fjPcH'></q></dir></style></legend>

      <small id='fjPcH'></small><noframes id='fjPcH'>

      <i id='fjPcH'><tr id='fjPcH'><dt id='fjPcH'><q id='fjPcH'><span id='fjPcH'><b id='fjPcH'><form id='fjPcH'><ins id='fjPcH'></ins><ul id='fjPcH'></ul><sub id='fjPcH'></sub></form><legend id='fjPcH'></legend><bdo id='fjPcH'><pre id='fjPcH'><center id='fjPcH'></center></pre></bdo></b><th id='fjPcH'></th></span></q></dt></tr></i><div id='fjPcH'><tfoot id='fjPcH'></tfoot><dl id='fjPcH'><fieldset id='fjPcH'></fieldset></dl></div>

    2. 使用 Lucene 提升新文档

      时间:2023-09-29

      <i id='tVfPI'><tr id='tVfPI'><dt id='tVfPI'><q id='tVfPI'><span id='tVfPI'><b id='tVfPI'><form id='tVfPI'><ins id='tVfPI'></ins><ul id='tVfPI'></ul><sub id='tVfPI'></sub></form><legend id='tVfPI'></legend><bdo id='tVfPI'><pre id='tVfPI'><center id='tVfPI'></center></pre></bdo></b><th id='tVfPI'></th></span></q></dt></tr></i><div id='tVfPI'><tfoot id='tVfPI'></tfoot><dl id='tVfPI'><fieldset id='tVfPI'></fieldset></dl></div>
          <tbody id='tVfPI'></tbody>

            • <legend id='tVfPI'><style id='tVfPI'><dir id='tVfPI'><q id='tVfPI'></q></dir></style></legend><tfoot id='tVfPI'></tfoot>

              <small id='tVfPI'></small><noframes id='tVfPI'>

                <bdo id='tVfPI'></bdo><ul id='tVfPI'></ul>
                本文介绍了使用 Lucene 提升新文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                Lucene 是否提供了一种增加新文档的方法?

                Does Lucene provide a means to boost fresh documents?

                例如,假设 Lucene 文档包含一个日期字段.是否有可能在不让用户改变她的查询的情况下,以更高的分数呈现最新的文档?

                For example suppose that the Lucene document includes a date field. Is it possible, without having the user to alter her query anyhow, to present the most recent documents with a higher score?

                我不想采用粗略的按日期排序"解决方案,因为它会完全取消评分算法.

                I do not want to resort to a coarse "sort by date" solution as it will completely cancel the scoring algorithm.

                推荐答案

                将文档放入索引时使用 Document.setBoost(float value).

                Use Document.setBoost(float value) when putting documents into the index.

                您可以不断地重新调整现有文档上的值,或者拥有一个随日期递增的浮点值,这样您只需将其应用于插入文档的时间.

                You can either constantly re-adjust the value on existing documents, OR have a float value that increments with date, so that you only need to apply it to the time that documents are inserted.

                例如,从第 1 天文档的提升值 0 开始.每天,boost 递增 1.它是一个浮点值,每年递增 365 会持续很长时间.

                For example, start with a boost value of 0 for day 1 documents. Each day, increment the boost by 1. It's a float value, incrementing by 365 each year will last a long time.

                您可能需要尝试增强的强度才能获得您想要的效果.

                You may have to experiment with the strength of the boost to get the effect you want.

                这篇关于使用 Lucene 提升新文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:在 Lucene 5.0 中按字母顺序排序字符串字段 下一篇:Lucene 性能

                相关文章

                最新文章

                • <bdo id='6dWWw'></bdo><ul id='6dWWw'></ul>
                <tfoot id='6dWWw'></tfoot>
                <legend id='6dWWw'><style id='6dWWw'><dir id='6dWWw'><q id='6dWWw'></q></dir></style></legend>

                    <i id='6dWWw'><tr id='6dWWw'><dt id='6dWWw'><q id='6dWWw'><span id='6dWWw'><b id='6dWWw'><form id='6dWWw'><ins id='6dWWw'></ins><ul id='6dWWw'></ul><sub id='6dWWw'></sub></form><legend id='6dWWw'></legend><bdo id='6dWWw'><pre id='6dWWw'><center id='6dWWw'></center></pre></bdo></b><th id='6dWWw'></th></span></q></dt></tr></i><div id='6dWWw'><tfoot id='6dWWw'></tfoot><dl id='6dWWw'><fieldset id='6dWWw'></fieldset></dl></div>

                    <small id='6dWWw'></small><noframes id='6dWWw'>