We're updating the issue view to help you get more done. 

Prefix for embedded many-to-one indexing is not applied correctly

Description

This is with the JAR from trunk I received from Emmanuel a few weeks ago:

@ManyToOne(fetch = FetchType.LAZY)
@org.hibernate.search.annotations.IndexedEmbedded(prefix = "createdBy_")
protected User createdBy;

@ManyToOne(fetch = FetchType.LAZY)
@org.hibernate.search.annotations.IndexedEmbedded(prefix = "lastModifiedBy_")
protected User lastModifiedBy;

And on User class (by the way, it doesn't work with @Indexed on that class, contrary to documentation):

@org.hibernate.search.annotations.Indexed
public class User implements Serializable {

@org.hibernate.search.annotations.DocumentId(name = "userId")
private Long id = null;

@org.hibernate.search.annotations.Field(
index = org.hibernate.search.annotations.Index.UN_TOKENIZED,
store = org.hibernate.search.annotations.Store.YES
)
private String username; // Unique and immutable
}

In the index (checked with Luke) I get:

<createdBy_userId>
<createdBy_username>
<createdBy_usernameusername>

instead of the desired

<createdBy_userId>
<createdBy_username>
<lastModifiedBy_username>

Environment

None

Status

Assignee

Unassigned

Reporter

Christian Bauer

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Priority

Major