Apache solr 查询中的布尔子句计数

问题描述 投票:0回答:1

注意:这里使用的Solr版本是8.11.1。

我正在探索 SOLR apache 的最大布尔查询功能区域,并且对如何在查询中计算布尔子句的数量感到有点困惑。下面是 3 个查询示例以及它计算的布尔查询数量。

“布尔查询中的子句太多:encountered=3通过 maxBooleanClauses=1 在 solrconfig.xml 中配置”, SolrQuery=rows=250&start=0&q=:&fq=((siteid:505)+OR+(metaData:userID*)+OR+(metaData:microBlogID*))+AND+(application:application_ms)&sort=score+desc&fl=id ,应用程序,元数据,siteid,docType_t,标签,contentAuthorName_t,contentAuthorID_i,folderID_i&defType=edismax&qt=/select

“布尔查询中的子句太多:encountered=2通过 maxBooleanClauses=1 在 solrconfig.xml 中配置” SolrQuery=rows=250&start=0&q=:&fq=((siteid:505+OR+siteid:504)+OR+(元数据:userID*)+OR+(元数据:microBlogID*))+AND+(application:application_ms)&排序=score+desc&fl=id,application,metaData,siteid,docType_t,tag,contentAuthorName_t,contentAuthorID_i,folderID_i&defType=edismax&qt=/select

“布尔查询中的子句太多:encountered=3通过 maxBooleanClauses=1 在 solrconfig.xml 中配置” SolrQuery=rows=250&start=0&q=:&fq=((siteid:505+OR+siteid:504+OR+siteid:503)+OR+(元数据:用户ID*)+OR+(元数据:微博ID*))+AND+ (application:application_ms)&sort=score+desc&fl=id,application,metaData,siteid,docType_t,tag,contentAuthorName_t,contentAuthorID_i,folderID_i&defType=edismax&qt=/select

有人可以解释一下这里的子句数量是如何计算的吗?

solr solr-query-syntax booleanquery solrconfig
1个回答
0
投票

在 Solr 8 中,我记得这是每个

BooleanQuery
(括号内的直接后代)强制执行的子句数量。通过嵌套,你可以颠覆这个限制。在 Solr 9 中,无论如何嵌套,它都是总子句。

在实践中,我发现这个限制弊大于利。它试图以阻止用户运行查询为代价来保护 Solr 性能,而这正是搜索的重点!我建议你把限制设置得很高,也许是一千。

© www.soinside.com 2019 - 2024. All rights reserved.