找出将maxClauseCount设置为1024错误的原因 [英] figuring out reason for maxClauseCount is set to 1024 error

查看:1016
本文介绍了找出将maxClauseCount设置为1024错误的原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两组搜索索引. TestIndex(在我们的测试环境中使用)和ProdIndex(在PRODUCTION环境中使用). Lucene搜索查询:+ date:[20090410184806 TO 20091007184806]可以很好地用于测试索引,但是会为Prod索引提供此错误消息.

I've two sets of search indexes. TestIndex (used in our test environment) and ProdIndex(used in PRODUCTION environment). Lucene search query: +date:[20090410184806 TO 20091007184806] works fine for test index but gives this error message for Prod index.

"maxClauseCount设置为1024"

"maxClauseCount is set to 1024"

如果在执行搜索查询之前执行以下行,则不会出现此错误. BooleanQuery.SetMaxClauseCount(Int16.MaxValue); searcher.Search(myQuery,collector);

If I execute following line just before executing search query, then I do not get this error. BooleanQuery.SetMaxClauseCount(Int16.MaxValue); searcher.Search(myQuery, collector);

我在这里错过了什么吗?为什么在测试索引中不会出现此错误?两个索引的架构是相同的,它们之间的记录/数据数量有所不同.PROD索引的记录数量(大约1300)比测试索引中的记录数量(大约950)高.

Am I missing something here? Why am not getting this error in test index?The schema for two indexes are same.They only differ wrt to number of records/data.PROD index has got higher number of records(around 1300) than those in test one (around 950).

推荐答案

范围查询本质上已转换为具有每个条件值的一个子句的布尔查询,或进行或运算.

The range query essentially gets transformed to a boolean query with one clause for every possible value, ORed together.

例如,查询+ price:[10到13]转换为布尔查询

For example, the query +price:[10 to 13] is tranformed to a boolean query

+(price:10 price:11 price:12 price:13)

假设所有值10-13都存在于索引中.

assuming all the values 10-13 exist in the index.

我想,您的所有1300个值都在您指定的范围内.因此,布尔查询具有1300个子句,该子句高于默认值1024.在测试索引中,由于只有950个值,因此未达到1024的限制.

I suppose, all of your 1300 values fall in the range you have given. So, boolean query has 1300 clauses, which is higher than the default value of 1024. In the test index, the limit of 1024 is not reached as there are only 950 values.

这篇关于找出将maxClauseCount设置为1024错误的原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆