如何使用 bf 使重音更准确,并使用 solr 进行查询
我使用 solr,我无法解决结果准确性的问题(q 与 bf 考虑到重音)
我有一个 solr 索引,其中有 2 个索引字段(这是简化的):
town, population
Félines, 100
Ferrand, 10000
当我查询时: q=Fé& qf=towntown_ascii&bf=population^2&defType=dismax
我希望在我的结果上按此顺序:Félines >费朗。
当我查询: q=Fe&qf=towntown_ascii&bf=population^2&defType=dismax
我想在我的结果中按此顺序: Ferrand > Félines
问题是 Ferrand 每次都会击败 Félines,因为它的人口更多,我该如何解决这个问题?我没有找到如何使用查询的分数并在 bf
中使用它来平衡人口
i work with solr, i can't fix my problem of result's accuracy (q vs bf taking into account accents)
i have a solr index with 2 fields indexed (this is simplified):
town, population
Félines, 100
Ferrand, 10000
when i query: q=Fé&qf=town town_ascii&bf=population^2&defType=dismax
I'd like this order on my results : Félines > Ferrand
.
When i query: q=Fe&qf=town town_ascii&bf=population^2&defType=dismax
I'd like this order on my results : Ferrand > Félines
The trouble is that Ferrand beats every time Félines because its population is bigger, how can i solve that? I didn't find how to use the score of the query and use it in bf
to balance population
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您没有发布
schema.xml
,但我想您正在使用ASCIIFoldingFilterFactory
作为town_ascii
字段。这意味着,如果您要对单词 Félines 建立索引,则以下是索引术语:因此,您的意思是
town
字段的匹配比town_ascii< 的匹配更重要/代码>。您应该将
qf
参数更改为qf=town^3town_ascii
之类的内容,以便为town
字段赋予更多权重。然后,您可以根据城镇
与人口
相比所需的权重来调整权重。You didn't post your
schema.xml
but I suppose you're using theASCIIFoldingFilterFactory
for thetown_ascii
field. It means that if you're indexing the word Félines the following are the indexed terms:Therefore, you're saying that a match for the
town
field is more important than a match fortown_ascii
. You should change theqf
parameter to something likeqf=town^3 town_ascii
to give more weight to thetown
field. Then you can adjust the weight depending on what is the desired weight fortown
compared topopulation
.