0
@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 中分析。这是正确的行为吗?

4

1 回答 1

0

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

于 2013-07-06T08:53:26.867 回答