hi!
with the following code i can find the telefonnumbers for a given person name.
(person.name is added to the telefon index)
is there a way to reverse this? e.g. find the person for a given telefonnumber?
(add telefon.telefon to the person index)
Code:
@Entity
@Indexed
public class Person implements java.io.Serializable
{
@Id
@GeneratedValue
@DocumentId
private long id;
@Field(index=Index.TOKENIZED)
private String name;
@ContainedIn
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "person")
private Set<Telefon> telefons = new HashSet<Telefon>(0);
...
}
@Entity
@Indexed
public class Telefon implements java.io.Serializable
{
@Id
@GeneratedValue
@DocumentId
private long id;
@Field(index=Index.TOKENIZED)
private String telefon;
@IndexedEmbedded
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "personid")
private Person person;
...
}
thx!