我们通过.Net ES客户端使用Nest。
被索引的Index文档看起来像这样:
[ElasticType(
Name = "tag",
DateDetection = true,
NumericDetection = true,
SearchAnalyzer = "standard",
IndexAnalyzer = "standard"
)]
public class TagIndexDto : AbstractIndexDto
{
[ElasticProperty(Index = FieldIndexOption.analyzed, OmitNorms = true)]
public string Name { get; set; }
[ElasticProperty(Index = FieldIndexOption.analyzed, OmitNorms = true)]
public string Description { get; set; }
[ElasticProperty(AddSortField = true)]
public int FollowerCount { get; set; }
[ElasticProperty(AddSortField = true)]
public int ProductCount { get; set; }
[ElasticProperty(AddSortField = true)]
public int CatalogCount { get; set; }
}
我想要做的是对3个计数(最后3个字段)的值进行特定的增强。并且boost应该是可配置的,这意味着在索引时尚不知道boost的确切值。
Lucene实际上支持吗? ES?还是我正在寻找一个不存在的功能?
谢谢
罗曼
最佳答案
在elasticsearch中,可以使用Custom Filters Score Query(更快但更不灵活)或Custom Score Query(更慢但更灵活)来完成
关于lucene - 增强对源文档属性的查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11828888/