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

  • <small id='iSiZZ'></small><noframes id='iSiZZ'>

        Lucene Proximity 搜索超过两个词的短语

        时间:2023-09-29

        • <bdo id='aP7Qp'></bdo><ul id='aP7Qp'></ul>

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

                <tbody id='aP7Qp'></tbody>
            1. <small id='aP7Qp'></small><noframes id='aP7Qp'>

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

                  本文介绍了Lucene Proximity 搜索超过两个词的短语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  Lucene 的手册中已经清楚地解释了邻近搜索的含义,其中包含两个单词,例如 "jakarta apache"~10 中的示例http://lucene.apache.org/core/2_9_4/queryparsersyntax.html#Proximity Searches

                  Lucene's manual has explained the meaning of proximity search for a phrase with two words clearly, such as the "jakarta apache"~10 example in http://lucene.apache.org/core/2_9_4/queryparsersyntax.html#Proximity Searches

                  但是,我想知道像 "jakarta apache lucene"~10 这样的搜索到底是做什么的?它是否允许相邻的单词最多相隔 10 个单词,或者所有成对的单词都是这样?

                  However, I am wondering what does a search like "jakarta apache lucene"~10 exactly do? Does it allow neighboring words to be at most 10 words apart, or all pairs of words to be that?

                  谢谢!

                  推荐答案

                  slop (proximity) 就像编辑距离一样工作(参见 PhraseQuery.setSlop).因此,这些条款可以重新排序或添加额外的条款.这意味着接近度将是添加到整个查询中的最大术语数.那就是:

                  The slop (proximity) works like an edit distance (see PhraseQuery.setSlop). So, the terms could be reordered or have extra terms added. This means that the proximity would be the maximum number of terms added into the whole query. That is:

                  "jakarta apache lucene"~3
                  

                  将匹配:

                  • jakarta lucene apache"(距离:2)
                  • "jakarta extra words here apache lucene"(距离:3)
                  • jakarta 一些词 apache 分隔 lucene"(距离:3)

                  但不是:

                  • lucene jakarta apache"(距离:4)
                  • "jakarta too many extra words here apache lucene"(距离:5)
                  • jakarta 一些话apache进一步分隔lucene"(距离:4)

                  有些人被以下的困惑:

                  lucene jakarta apache"(距离:4)

                  "lucene jakarta apache" (distance: 4)

                  简单的解释是交换术语需要两次编辑,所以:

                  The simple explanation is that swapping terms takes two edits, so:

                  1. jakarta apache lucene(距离:0)
                  2. jakarta lucene apache(第一次交换,距离:2)
                  3. lucene jakarta apache(第二次交换,距离:4)

                  更长但更准确的解释是,每次编辑都允许将术语移动一个位置.交换的第一步将两个术语相互交换.牢记这一点解释了为什么任何三个术语的集合都可以重新排列成距离不大于 4 的任何顺序.

                  The longer, but more accurate, explanation is that every edit allows a term to be moved by one position. The first move of a swap transposes two terms on top of each other. Keeping this in mind explains why any set of three terms can be rearranged into any order with distance no greater than 4.

                  1. jakarta apache lucene(距离:0)
                  2. jakarta [apache,lucene](距离:1)
                  3. [jakarta,apache,lucene](都转置在同一个位置,距离:2)
                  4. lucene [jakarta,apache](距离:3)
                  5. lucene jakarta apache(距离:4)

                  这篇关于Lucene Proximity 搜索超过两个词的短语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在 Lucene 3.0.2 中索引和搜索文本文件? 下一篇:如何使用 TermVector Lucene 4.0

                  相关文章

                  最新文章

                  1. <tfoot id='eZ6x7'></tfoot>
                  2. <small id='eZ6x7'></small><noframes id='eZ6x7'>

                    • <bdo id='eZ6x7'></bdo><ul id='eZ6x7'></ul>

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