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

        <small id='4mkjg'></small><noframes id='4mkjg'>

        • <bdo id='4mkjg'></bdo><ul id='4mkjg'></ul>

      1. KeywordAnalyzer 和 LowerCaseFilter/LowerCaseTokenizer

        时间:2023-06-29

      2. <small id='IaVpp'></small><noframes id='IaVpp'>

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

            <i id='IaVpp'><tr id='IaVpp'><dt id='IaVpp'><q id='IaVpp'><span id='IaVpp'><b id='IaVpp'><form id='IaVpp'><ins id='IaVpp'></ins><ul id='IaVpp'></ul><sub id='IaVpp'></sub></form><legend id='IaVpp'></legend><bdo id='IaVpp'><pre id='IaVpp'><center id='IaVpp'></center></pre></bdo></b><th id='IaVpp'></th></span></q></dt></tr></i><div id='IaVpp'><tfoot id='IaVpp'></tfoot><dl id='IaVpp'><fieldset id='IaVpp'></fieldset></dl></div>
            <tfoot id='IaVpp'></tfoot>
              <bdo id='IaVpp'></bdo><ul id='IaVpp'></ul>
                    <tbody id='IaVpp'></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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文章

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

                  • <bdo id='YVxNm'></bdo><ul id='YVxNm'></ul>
                • <small id='YVxNm'></small><noframes id='YVxNm'>

                    1. <tfoot id='YVxNm'></tfoot>

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