Hi
Basically what you want to do is something like this:
Code:
@Indexed
public class Street {
@Field(<define field values>)
private String streetName;
@IndexEmbedded
Set<AlternativeStreetName> streetNames;
...
}
public class AlternativeStreetName {
@Field(<define field>)
private String alternativeStreetName;
@ContainedIn
private Street street;
...
}
This should basically allow you to do queries like
streetName
streetNames.alternativeStreetName
You will need to configure the query to return the Street object. You can look at the Hibernate Search documentation for more info.
Hope that helps.
P.S. My mappings may be incorrect but the above gives you a rough idea. Also I would recommend getting Hibernate Search Action which is an invaluable resource if you're building Hibernate Search into your domain model.