【问题标题】:hibernate search analysis not performed on the field @IndexedEmbedded未在字段@IndexedEmbedded 上执行休眠搜索分析
【发布时间】:2013-07-04 19:29:18
【问题描述】:
@Indexed
public class Event implements Serializable {

    @DocumentId
    private Long id;    

    @Field
    @AnalyzerDiscriminator(impl = LanguageDiscriminator.class) // "de", GermanAnalyzer
    private String lang;               

    @IndexedEmbedded    
    private User user;

}

@Indexed
@Analyzer(impl = GermanAnalyzer.class)
public class User implements Serializable {        

    @DocumentId   
    private Long id;           

    @Field
    private String firstName;

  }

firstName 字段将在索引 User 中进行分析,而不会在索引 Event 中进行分析。 这是不是正确的行为?

【问题讨论】:

    标签: search lucene hibernate-search


    【解决方案1】:

    它将在 Event 索引中进行分析,但在这种情况下,字段名称将是 user.firstName。您可以使用 @IndexedEmbedded 的可选属性覆盖默认前缀。

    【讨论】:

    • 没有进行字段分析!它被添加到名称“user.firstName”下的索引“事件”中,但没有进行分析!
    猜你喜欢
    • 2011-11-17
    • 1970-01-01
    • 1970-01-01
    • 2019-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-17
    相关资源
    最近更新 更多