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

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

    1. <legend id='MC5hp'><style id='MC5hp'><dir id='MC5hp'><q id='MC5hp'></q></dir></style></legend>
        <bdo id='MC5hp'></bdo><ul id='MC5hp'></ul>
      <tfoot id='MC5hp'></tfoot>

      1. Lucene 搜索结果按自定义订单列表排序(每个用户唯

        时间:2023-09-29

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

              <tbody id='Dzu18'></tbody>

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

                  本文介绍了Lucene 搜索结果按自定义订单列表排序(每个用户唯一)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我的应用程序中有经过身份验证的用户可以访问包含多达 500,000 个项目的共享数据库.每个用户都有自己的面向公众的网站,并且需要能够优先考虑在他们自己的网站上展示的项目(想想赞成).

                  I have authenticated users in my application who have access to a shared database of up to 500,000 items. Each of the users has their own public facing web site and needs the ability to prioritize the items on display (think upvote) on their own site.

                  在 500,000 个项目中,他们最多可能只有 200 个优先项目,其余项目的顺序不太重要.

                  out of the 500,000 items they may only have up to 200 prioritized items, the order of the rest of the items is of less importance.

                  每个用户对项目的优先级不同.

                  Each of the users will prioritize the items differently.

                  我最初在这里问了一个类似的 mysql 问题 Mysql 结果按每个用户唯一的列表排序 并得到了很好的答案,但我相信更好的选择可能是选择非 sql 索引解决方案.

                  I initially asked a similar mysql question here Mysql results sorted by list which is unique for each user and got a good answer but i believe a better option may be to opt for a non sql indexed solution.

                  这可以在 Lucene 中完成吗?是否有另一种搜索技术会更好.

                  Can this be done in Lucene?, is there another search technology which would be better for this.

                  ps.Google 对其搜索结果实施了类似的类型设置,如果您已登录,您可以在其中优先考虑和排除您自己的搜索结果.

                  ps. Google implements a similar type setup with their search results where you can prioritize and exclude your own search results if you are logged in.

                  更新:在我阅读文档时重新标记为 sphinx,我相信它可能能够通过存储在内存中的每个文档属性值"来完成我正在寻找的事情 - 有兴趣听到对此的任何反馈来自斯芬克斯大师

                  Update: re-tagged with sphinx as i have been reading the documentation and i believe it may be able to do what i am looking for with "per-document attribute values" stored in memory - interested to hear any feedback on this from sphinx gurus

                  推荐答案

                  在构建索引时,您肯定希望将 item 的 id 存储在每个文档对象中.有几种方法可以进行下一步,但一种简单的方法是获取优先项并将它们添加到您的搜索查询中,对于每个特殊项如下所示:

                  You'll definitely want to store the id of item in each document object when building your index. There's a few ways to do the next step, but an easy one would be take the prioritized items and add them to your search query, something like this for each special item:

                  "OR item_id=%d+X"
                  

                  其中 X 是您想要使用的提升量.您可能需要根据经验调整此数字,以确保仅被点赞"不会将其置于搜索完全不相关内容的列表的顶部.

                  where X is the amount of boost you'd like to use. You'll probably need to empirically tweak this number to make sure that just being "upvoted" doesn't put it to the top of a list searching for something totally unrelated.

                  这样做至少可以避免很多烦人的后处理步骤,这些步骤需要您遍历整个结果集——希望从查询索引开始就可以进行正确的排序.

                  Doing it this way will at least prevent you from a lot of annoying postprocessing steps that would require you to iterate over the whole result set -- hopefully the proper sorting will be there right from querying the index.

                  这篇关于Lucene 搜索结果按自定义订单列表排序(每个用户唯一)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Lucene JDBC 目录 下一篇:Java Swing - 如何在另一个面板上显示一个面板?

                  相关文章

                  最新文章

                  1. <small id='3dsjQ'></small><noframes id='3dsjQ'>

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

                        <bdo id='3dsjQ'></bdo><ul id='3dsjQ'></ul>