Search Solr-仅当找到其他字段时才包含字段
假设我有田地Search Solr-仅当找到其他字段时才包含字段,search,solr,field,relevance,Search,Solr,Field,Relevance,假设我有田地 textFieldA textFieldB specialC 在我的索引中。现在我想用 textFieldA:"searchVal" textFieldB:"searchVal" specialC:"somecode" 但是我只想在specialC上增加匹配,如果在至少一个其他字段上也有匹配 例子: 现在,当使用搜索示例时 textFieldA:"test" textFieldB:"test" specialC:"supercode" 我想要结果 DocumentC Docu
textFieldA
textFieldB
specialC
在我的索引中。现在我想用
textFieldA:"searchVal" textFieldB:"searchVal" specialC:"somecode"
但是我只想在specialC
上增加匹配,如果在至少一个其他字段上也有匹配
例子:
现在,当使用搜索示例时
textFieldA:"test" textFieldB:"test" specialC:"supercode"
我想要结果
DocumentC
DocumentA
文件C的排名最高,但文件B被排除在外
如何做到这一点
q=textFieldA:"test" OR textFieldB:"test" OR textFieldA:"test" AND specialC:"supercode" OR textFieldB:"test" AND specialC:"supercode"&bq=(specialC:"supercode")^100
应仅按所需顺序返回DocumentC和DocumentA。bq意味着增加一个字段/字段值,详见此处
据我所知,只有当你真正查询你想要提升的东西时,查询提升才会起作用(有点直观)。这就是为什么我将最后两部分添加到查询中 由于specialC没有“超级代码”的价值,DocumentA如何匹配?在开始的时候,你提到specialC应该匹配,如果在其他野外教学中至少有一个匹配,我会更正我的问题。我的意思是,只在specialC字段上进行匹配应该会提高值,所以只在specialC字段上进行匹配不应该包括在内
q=textFieldA:"test" OR textFieldB:"test" OR textFieldA:"test" AND specialC:"supercode" OR textFieldB:"test" AND specialC:"supercode"&bq=(specialC:"supercode")^100