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

    1. <small id='e6Qya'></small><noframes id='e6Qya'>

      <tfoot id='e6Qya'></tfoot>
      <legend id='e6Qya'><style id='e6Qya'><dir id='e6Qya'><q id='e6Qya'></q></dir></style></legend>

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

        如何使用多短语查询?

        时间:2023-06-28

          <bdo id='QhkIy'></bdo><ul id='QhkIy'></ul>
            <tfoot id='QhkIy'></tfoot>

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

                    <tbody id='QhkIy'></tbody>

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

                  <legend id='QhkIy'><style id='QhkIy'><dir id='QhkIy'><q id='QhkIy'></q></dir></style></legend>
                  本文介绍了如何使用多短语查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  http://lucene.apache.org/java/2_3_1/api/core/org/apache/lucene/search/MultiPhraseQuery.html

                  对于示例Microsoft app*",他说使用 IndexReader.term() 但返回 TermEnum,我如何将它放入 MultiPhraseQueryParser ?

                  for the example "Microsoft app*", he says use IndexReader.term() but that returns TermEnum, how do I put it in MultiPhraseQueryParser ?

                  或者有人告诉我如何在 Microsoft 应用程序* 上以更好的方式搜索超过 7.5 GB 的索引!!

                  Or someone tell me how do I do a search on Microsoft app* in a better way over a 7.5 GB index!!

                  推荐答案

                  您需要迭代 TermEnum 以获取条款.您可以迭代 TermEnum 以获取以app"开头的术语,如下所示.

                  You need to iterate on TermEnum to get the terms. You can iterate on the TermEnum to get terms starting with "app" as follows.

                      TermEnum te = reader.terms(new Term("field", "app"));
                      List<Term> termList = new LinkedList<Term>();       
                      while(te.next()) {
                          Term t = te.term();
                          if (!t.field().equals("field") || !t.text().startsWith("app")) {
                              break;
                          }
                          termList.add(t);
                      }
                      Term[] terms = termList.toArray(new Term[0]);
                  

                  这篇关于如何使用多短语查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                    <tfoot id='XNwzr'></tfoot>

                        <bdo id='XNwzr'></bdo><ul id='XNwzr'></ul>

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

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

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