lucene - 增强对源文档属性的查询

标签 lucene elasticsearch

我们通过.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/

相关文章:

java - 在 Lucene 中使用 WikipediaTokenizer 的示例

java - 如何在 Lucene 中实现 tf-idf 和余弦相似度?

search - Elasticsearch 中的嵌套 vs 对象

elasticsearch - 将机器中一个节点的 Elasticsearch 索引移动到同一台机器的另一个驱动器

elasticsearch - spring-data-elasticsearch - 注册自定义分析器

lucene - Solr 关联

indexing - 如何在 GUI 中获取 Hibernate Lucene 索引创建的统计信息?

lucene - Solr - 将 "Add"发布到服务器时出错

ruby-on-rails - Elasticsearch 模型 gem(rails),向映射添加新字段

elasticsearch - 配置标准 token 生成器elasticsearch