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

    <small id='2CCPn'></small><noframes id='2CCPn'>

  1. <tfoot id='2CCPn'></tfoot>

    <legend id='2CCPn'><style id='2CCPn'><dir id='2CCPn'><q id='2CCPn'></q></dir></style></legend>
      • <bdo id='2CCPn'></bdo><ul id='2CCPn'></ul>

      为什么过滤器不适用于 Lucene.Net 中的文本/字符串值?

      Why is filter not working with text/string values in Lucene.Net?(为什么过滤器不适用于 Lucene.Net 中的文本/字符串值?)

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

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

                <tfoot id='hgJ1v'></tfoot>
                本文介绍了为什么过滤器不适用于 Lucene.Net 中的文本/字符串值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我在 Lucene.Net 中做了一个过滤器来限制搜索的结果.我遇到了一个非常奇怪的问题.过滤器不适用于文本值,而是处理数字值.

                I have made a filter in Lucene.Net to limit the result of the search. I am encountering a very strange issue. The filter is not working with Text Values but working with number values.

                例如:

                如果我正在制作一个带有数字值的过滤器,如下所示.它运行良好.

                If I am making a filter with Number values something like below. It is working perfectly.

                String field = "id";
                Filter LE= new QueryWrapperFilter(new TermQuery( new Term(field, "1234567")));
                indexSearcher.Search(QueryMaker(searchString, searchfields), LE, coll);
                

                但是,如果我给出一个包含 Text 的值

                However, if I give a value containing Text

                String field = "id";
                Filter LE = new QueryWrapperFilter(new TermQuery(new Term(field, "ZZZOCB9X9Y")));
                indexSearcher.Search(QueryMaker(searchString, searchfields), LE, coll);
                

                它失败了.结果没有显示任何记录.

                it is failing. The result is not displaying any records.

                谁能解释一下这个问题.此外,我已经对其进行了多次测试以提出此要求.我在一些论坛上读到 Lucene 版本低于 3 的 Term Query 可能会有这个问题.但是,我已将版本更改为 3.0.3,但错误仍然存在.我非常需要程序中的过滤器才能工作.否则我将不得不离开 Lucene 并寻找其他东西.

                Can somebody explain me the issue. Also, I have tested it numerous times to make this claim. I have read on some forums that the Term Query in Lucene versions below 3 will probably have this issue. However, I have changed the version to 3.0.3 but error still persists. I badly need the filter in my program to work. Otherwise I will have to move away from Lucene and find something else.

                推荐答案

                StandardAnalyzer 会将 TokenStream 中的所有字符小写.

                StandardAnalyzer will lowercase all the characters in your TokenStream.

                试试这个:

                Filter LE = new QueryWrapperFilter(new TermQuery(new Term(field, "ZZZOCB9X9Y".ToLowerInvariant())));
                

                这篇关于为什么过滤器不适用于 Lucene.Net 中的文本/字符串值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                C# namespace alias - what#39;s the point?(C# 命名空间别名 - 有什么意义?)
                Using Xpath With Default Namespace in C#(在 C# 中使用具有默认命名空间的 Xpath)
                Generating an EDMX from a DB2 Database(从 DB2 数据库生成 EDMX)
                IBM .NET Data Provider Connection String issue with Library List(库列表的 IBM .NET 数据提供程序连接字符串问题)
                .NET DB2 OLEDB pre-requisites(.NET DB2 OLEDB 先决条件)
                Referring to Code in IBM.Data.DB2 makes that Assembly Unavailable to the rest of my Solution(引用 IBM.Data.DB2 中的代码使该程序集对我的解决方案的其余部分不可用)

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

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

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