SolrConfig maxBooleanClauses请求参数设置

108 阅读1分钟

本文档基于solr7.0文档进行说明

在使用小数据量或者简单检索,solr的默认配置可以满足我们的需求,当我们进行大数据量查询或类似于in查询时,solr的默认配置就没办法满足我们的需求,就会爆发如下一些问题

###1. maxBooleanClauses

solr默认的如下:

Maximum number of clauses in each BooleanQuery,  an exception
         is thrown if exceeded.  It is safe to increase or remove this setting,
         since it is purely an arbitrary limit to try and catch user errors where
         large boolean queries may not be the best implementation choice.

<maxBooleanClauses>1024</maxBooleanClauses>
如果我们在实际项目中,使用大数据量的in查询,solr就会报maxBooleanClauses 异常,这时可以将查询条件分区或者设置更大的maxBooleanClauses。一般设置为负数,表示无穷;查看了solr7.0文档,暂不支持设置。

###2.RequestDispatcher 官网地址 The requestDispatcher element of solrconfig.xml controls the way the Solr HTTP RequestDispatcher implementation responds to requests.

使用中如果request报异常可以查看相应的参数,进行修改调试