• <bdo id='u5zfR'></bdo><ul id='u5zfR'></ul>
    <tfoot id='u5zfR'></tfoot>

    <legend id='u5zfR'><style id='u5zfR'><dir id='u5zfR'><q id='u5zfR'></q></dir></style></legend>

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

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

        Lucene search results sort by custom order list (unique to each user)(Lucene 搜索结果按自定义订单列表排序(每个用户唯一))
          <tbody id='AzO34'></tbody>
        <legend id='AzO34'><style id='AzO34'><dir id='AzO34'><q id='AzO34'></q></dir></style></legend>

      3. <small id='AzO34'></small><noframes id='AzO34'>

          1. <i id='AzO34'><tr id='AzO34'><dt id='AzO34'><q id='AzO34'><span id='AzO34'><b id='AzO34'><form id='AzO34'><ins id='AzO34'></ins><ul id='AzO34'></ul><sub id='AzO34'></sub></form><legend id='AzO34'></legend><bdo id='AzO34'><pre id='AzO34'><center id='AzO34'></center></pre></bdo></b><th id='AzO34'></th></span></q></dt></tr></i><div id='AzO34'><tfoot id='AzO34'></tfoot><dl id='AzO34'><fieldset id='AzO34'></fieldset></dl></div>
              <bdo id='AzO34'></bdo><ul id='AzO34'></ul>
                  <tfoot id='AzO34'></tfoot>
                • 本文介绍了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 搜索结果按自定义订单列表排序(每个用户唯一)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Lucene Porter Stemmer not public(Lucene Porter Stemmer 未公开)
                  How to index pdf, ppt, xl files in lucene (java based or python or php any of these is fine)?(如何在 lucene 中索引 pdf、ppt、xl 文件(基于 java 或 python 或 php 中的任何一个都可以)?)
                  KeywordAnalyzer and LowerCaseFilter/LowerCaseTokenizer(KeywordAnalyzer 和 LowerCaseFilter/LowerCaseTokenizer)
                  How to search between dates (Hibernate Search)?(如何在日期之间搜索(休眠搜索)?)
                  How to get positions from a document term vector in Lucene?(如何从 Lucene 中的文档术语向量中获取位置?)
                  Java Lucene 4.5 how to search by case insensitive(Java Lucene 4.5如何按不区分大小写进行搜索)
                  1. <i id='mM7EM'><tr id='mM7EM'><dt id='mM7EM'><q id='mM7EM'><span id='mM7EM'><b id='mM7EM'><form id='mM7EM'><ins id='mM7EM'></ins><ul id='mM7EM'></ul><sub id='mM7EM'></sub></form><legend id='mM7EM'></legend><bdo id='mM7EM'><pre id='mM7EM'><center id='mM7EM'></center></pre></bdo></b><th id='mM7EM'></th></span></q></dt></tr></i><div id='mM7EM'><tfoot id='mM7EM'></tfoot><dl id='mM7EM'><fieldset id='mM7EM'></fieldset></dl></div>
                        <tbody id='mM7EM'></tbody>
                    • <tfoot id='mM7EM'></tfoot>

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

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