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

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

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

      2. KeywordAnalyzer 和 LowerCaseFilter/LowerCaseTokenizer

        时间:2023-09-30

          <small id='786OU'></small><noframes id='786OU'>

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

                  本文介绍了KeywordAnalyzer 和 LowerCaseFilter/LowerCaseTokenizer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我想构建自己的分析器,同时使用过滤器/标记器.

                  I want to build my own analyzer that uses both filters/tokenizers.

                  我的意思是,相同的字段是 Keyword(整个流作为单个标记)和小写

                  I mean, the same field is Keyword (entire stream as a single token) and lowercase

                  如果 KeywordAnalyzer仅使用,字段的值不区分大小写.如果我使用 LowerCaseTokenizer 或LowerCaseFilter 我要结合它们与其他执行相同操作的分析器 KeywordAnalyzer(不使用字母、空格、删除停用词等分隔)

                  If KeywordAnalyzer use only, the value of field keeps the case-insensitive. If I use LowerCaseTokenizer or LowerCaseFilter I have to combine them with other analyzers that do the same thing KeywordAnalyzer (separated by no letter, by spaces, remove stop-words, etc.)

                  问题是:有没有办法使用过滤器或分析器 Lucene 或标记器将该字段设为关键字(将整个流作为单个标记)和 小写?

                  The question is: Is there any way to make that field as Keyword (entire stream as a single token) and that lowercase using filters or analyzers Lucene or tokenizers?

                  (谷歌翻译,错误见谅)

                  (google translated, sorry about errors)

                  推荐答案

                  这应该可行:

                  public final class YourAnalyzer extends ReusableAnalyzerBase { 
                  
                    @Override
                    protected TokenStreamComponents createComponents(final String fieldName, final Reader reader) {
                      final TokenStream source = new KeywordTokenizer(reader);
                      return new TokenStreamComponents(source, new LowercaseFilter(Version.LUCENE_36, source));
                    }
                  }
                  

                  这篇关于KeywordAnalyzer 和 LowerCaseFilter/LowerCaseTokenizer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在日期之间搜索(休眠搜索)? 下一篇:如何在 lucene 中索引 pdf、ppt、xl 文件(基于 java 或

                  相关文章

                  最新文章

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

                    <bdo id='thPWW'></bdo><ul id='thPWW'></ul>
                  <legend id='thPWW'><style id='thPWW'><dir id='thPWW'><q id='thPWW'></q></dir></style></legend>

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

                    <tfoot id='thPWW'></tfoot>