Hi,
1. I'm a complete HSearch/Lucene beginner.
2. I have read both Hibernate in Action (2sd Ed) and Hibernate Search in action, searched the forums, but found (almost) nothing...
3. Versions of Hibernate are the latest (since it's a new project)
I'm in the process of creating a data model with some fields in several languages. For example :
Code:
class Product
{
@Column(
name = "description",
nullable = false
)
@JoinTable(joinColumns = @JoinColumn(name = "productId"))
@org.hibernate.annotations.CollectionOfElements(fetch = FetchType.EAGER)
@org.hibernate.annotations.ForeignKey(name = "products_key")
@org.hibernate.annotations.MapKey(
columns =
@Column(
length = 2,
name = "locale"
)
)
private Map<String, String> descriptions = new Hashtable<String, String>();
}
"descriptions" is a map with the key being the locale and the value the description in that locale, eg {{"en","my product"}, {"fr","mon produit"}}.
So far so good, but now the problem is indexing each description with the right analyzer, ie for the language used for the current row.
1. I found on this forum a thread mentioning "AnalyzerDiscriminator", but it seems it cannot be applied to a Map, does it?
2. I'm thinking to convert Map<Locale,String> to List<I15nData> (I15nData being a simple structure with a locale and a description fields) and applying "AnalyzerDiscriminator" to I15nData.
Please can someone give me some input on this?
Thanks
David