本文介绍了Lucene.Net.Search.BooleanQuery + TooManyClauses:系统错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下参数进行搜索,我想知道为什么有人会引发此异常.

I am trying to search with the below params, and I am wondering why some cause this exception to be thrown.

只有一些参数不起作用.其他所有人都在工作.

Only a few params are not working. All others are working.

  • ?q = 220v + 0 + ph =>不起作用
  • ?q = 220v + 1 + ph =>不起作用
  • ?q = 220v + 2 + ph =>不起作用
  • ?q = 220v + 3 + ph =>不起作用
  • ?q = 220v + 4 + ph =>工作正常
  • ?q = 220v + 5 + ph =>工作正常
  • ?q = 220v + 6 + ph =>工作正常
  • ?q = 220v + 7 + ph =>工作正常
  • ?q = 220v + 8 + ph =>工作正常
  • ?q = 220v + 9 + ph =>工作正常
  • ?q=220v+0+ph => Not working
  • ?q=220v+1+ph => Not working
  • ?q=220v+2+ph => Not working
  • ?q=220v+3+ph => Not working
  • ?q=220v+4+ph => Working
  • ?q=220v+5+ph => Working
  • ?q=220v+6+ph => Working
  • ?q=220v+7+ph => Working
  • ?q=220v+8+ph => Working
  • ?q=220v+9+ph => Working

我正在检查中心字符.它不仅在0、1、2和3的情况下有效.

I am checking the center character. It is not working only in the cases of 0, 1, 2 and 3.

查询: {+(标题:480v *内容:480v标题:3 *内容:3标题:ph *内容:ph)

推荐答案

您的一个或多个通配符查询生成了过多的字词匹配项.通过枚举所有匹配项来重写通配符查询,并创建一组与它们匹配的原始查询,并结合在 BooleanQuery 中.

One or more of your wildcard queries is generating too many term matches. Wildcard queries are rewritten by enumerating all of the matching terms, and create a set of primitive queries matching them, combined in a BooleanQuery.

例如,查询 title:foo * 可以在包含这些术语的索引中重写为 title:foobar title:food title:foolish title:footpad

For instance, the query title:foo*, could be rewritten to title:foobar title:food title:foolish title:footpad, in an index containing those terms.

默认情况下, BooleanQuery 最多允许1024个子句.例如,如果索引中匹配 title:0 * 的索引中有超过1024个不同术语,则可能是您的问题.

By default, a BooleanQuery allows a maximum of 1024 clauses. If you have over 1024 different terms in the index matching title:0*, for instance, that is likely your problem.

这篇关于Lucene.Net.Search.BooleanQuery + TooManyClauses:系统错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 04:31