久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

  • <i id='PIN7d'><tr id='PIN7d'><dt id='PIN7d'><q id='PIN7d'><span id='PIN7d'><b id='PIN7d'><form id='PIN7d'><ins id='PIN7d'></ins><ul id='PIN7d'></ul><sub id='PIN7d'></sub></form><legend id='PIN7d'></legend><bdo id='PIN7d'><pre id='PIN7d'><center id='PIN7d'></center></pre></bdo></b><th id='PIN7d'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='PIN7d'><tfoot id='PIN7d'></tfoot><dl id='PIN7d'><fieldset id='PIN7d'></fieldset></dl></div>
    1. <legend id='PIN7d'><style id='PIN7d'><dir id='PIN7d'><q id='PIN7d'></q></dir></style></legend>
    2. <tfoot id='PIN7d'></tfoot>

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

        如何從 Lucene 中的文檔術語向量中獲取位置?

        How to get positions from a document term vector in Lucene?(如何從 Lucene 中的文檔術語向量中獲取位置?)
          <i id='mO7Dm'><tr id='mO7Dm'><dt id='mO7Dm'><q id='mO7Dm'><span id='mO7Dm'><b id='mO7Dm'><form id='mO7Dm'><ins id='mO7Dm'></ins><ul id='mO7Dm'></ul><sub id='mO7Dm'></sub></form><legend id='mO7Dm'></legend><bdo id='mO7Dm'><pre id='mO7Dm'><center id='mO7Dm'></center></pre></bdo></b><th id='mO7Dm'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='mO7Dm'><tfoot id='mO7Dm'></tfoot><dl id='mO7Dm'><fieldset id='mO7Dm'></fieldset></dl></div>
              <tbody id='mO7Dm'></tbody>
            <legend id='mO7Dm'><style id='mO7Dm'><dir id='mO7Dm'><q id='mO7Dm'></q></dir></style></legend>
          • <small id='mO7Dm'></small><noframes id='mO7Dm'>

            <tfoot id='mO7Dm'></tfoot>
              • <bdo id='mO7Dm'></bdo><ul id='mO7Dm'></ul>
                  本文介紹了如何從 Lucene 中的文檔術語向量中獲取位置?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我需要遍歷 Lucene 索引中的所有文檔,并獲取每個術語在每個文檔中出現(xiàn)的位置.據(jù)我能夠從 Lucene javadoc 中了解到,這樣做的方法是執(zhí)行以下操作:

                  I need to iterate over all documents in a Lucene index, and obtain the positions at which each term occurs in each document. As far as I am able to understand from the Lucene javadoc, the way to do this is to do something like this:

                  IndexReader ir = obtainIndexReader();
                  Terms tv = ir.getTermVector( doc, field );
                  TermsEnum terms = tv.iterator();
                  PostingsEnum p = null;
                  while( terms.next() != null ) {
                      p = terms.postings( p, PostingsEnum.ALL );
                      while( p.nextDoc() != PostingsEnum.NO_MORE_DOCS ) {
                          int freq = p.freq();
                          for( int i = 0; i < freq; i++ ) {
                              int pos = p.nextPosition();   // Always returns -1!!!
                              BytesRef data = p.getPayload();
                              doStuff( freq, pos, data ); // Fails miserably, of course.
                          }
                      }
                  }
                  

                  但是,即使 (1) 索引確實包含相關字段上的位置,并且 (2) 術語向量聲稱具有位置(即:tv.hasPositions() == true),我仍然得到-1" 適用于所有職位.

                  However, even though (1) the index does indeed include positions on the relevant field and (2) the term vector claims to have positions (i.e.: tv.hasPositions() == true), I keep getting "-1" for all positions.

                  首先,我是不是做錯了什么?是否有另一種方法可以在每個文檔的基礎上迭代過帳?第二:到底發(fā)生了什么?該索引包含位置,getTermVector 返回的術語實例聲稱包含位置,并且我正在查看 Luke 中的正確位置值,但是當我嘗試在我的代碼中訪問所述值時仍然得到 -1.什么給了?

                  First, am I doing something wrong? Is there an alternative way of iterating over postings on a per-document basis? Second: What is going on anyway? The index contains positions, the Terms instance returned by getTermVector claims to include positions, and I'm looking at the correct position values in Luke, yet I still get -1 when I try to access said values in my code. What gives?

                  相關字段配置有以下選項:

                  The relevant field was configured with the following options:

                      FieldType ft = new FieldType();
                      ft.setIndexOptions( IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS );
                      ft.setStoreTermVectors( true );
                      ft.setStoreTermVectorOffsets( true );
                      ft.setStoreTermVectorPayloads( true );
                      ft.setStoreTermVectorPositions( true );
                      ft.setTokenized( true );
                      return ft;
                  

                  推薦答案

                  您是否在索引時為您的字段類型設置了 FieldType.setStoreTermVectorPositions(true)?http://lucene.apache.org/core/5_5_0/core/org/apache/lucene/document/FieldType.html#setStoreTermVectorPositions(boolean)

                  Did you set FieldType.setStoreTermVectorPositions(true) on your field type at index time? http://lucene.apache.org/core/5_5_0/core/org/apache/lucene/document/FieldType.html#setStoreTermVectorPositions(boolean)

                  這篇關于如何從 Lucene 中的文檔術語向量中獲取位置?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數(shù)溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數(shù)轉換為整數(shù)?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創(chuàng)建一個隨機打亂數(shù)字的 int 數(shù)組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)

                • <i id='aGhZW'><tr id='aGhZW'><dt id='aGhZW'><q id='aGhZW'><span id='aGhZW'><b id='aGhZW'><form id='aGhZW'><ins id='aGhZW'></ins><ul id='aGhZW'></ul><sub id='aGhZW'></sub></form><legend id='aGhZW'></legend><bdo id='aGhZW'><pre id='aGhZW'><center id='aGhZW'></center></pre></bdo></b><th id='aGhZW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='aGhZW'><tfoot id='aGhZW'></tfoot><dl id='aGhZW'><fieldset id='aGhZW'></fieldset></dl></div>
                  1. <legend id='aGhZW'><style id='aGhZW'><dir id='aGhZW'><q id='aGhZW'></q></dir></style></legend><tfoot id='aGhZW'></tfoot>
                    • <bdo id='aGhZW'></bdo><ul id='aGhZW'></ul>
                        <tbody id='aGhZW'></tbody>
                        • <small id='aGhZW'></small><noframes id='aGhZW'>

                            主站蜘蛛池模板: 免费不卡视频 | 久久岛国| 九九久久国产 | 一本色道精品久久一区二区三区 | a级毛片基地| 精品久久国产 | 91资源在线 | 国产精品久久av | 久久久九九 | 国产高清在线 | 日本a在线 | 成人不卡 | 黄a在线播放 | www.久草.com| 国产成人av在线播放 | 成人一区二区在线 | 欧美激情久久久 | 久久久久久久久久久久一区二区 | 天天影视综合 | 91精品在线播放 | com.色.www在线观看 | 日韩视频中文字幕 | 国产精品国产成人国产三级 | 成人在线免费电影 | 一级免费毛片 | 仙人掌旅馆在线观看 | 国产欧美一区二区三区在线看 | 亚洲va国产日韩欧美精品色婷婷 | 亚洲成人精品久久 | 欧美精品在线一区二区三区 | 精品在线99 | 国产h视频| 欧美11一13sex性hd | 另类在线 | 日日操夜夜操天天操 | www亚洲免费国内精品 | 99爱在线 | 国产高清视频 | 久久三区 | 日本精品一区二区三区视频 | 久久新 |