sanne.grinovero wrote:
Could you describe the use case? find it quite puzzling.
The use case is Bar may be a large, complex object. When I search Foo, I want to filter on the associated Bars - not the values within the Bars, but which ones are attached to Foo. And I don't want to pull all the fields from Bar up into Foo's index. In our user interface, we do this with a select menu; the user selects one or more Bars and their IDs get added to the Lucene query against the Foo object. Make sense?
@SearchableReference is very much like @IndexedEmbedded, except the only field that gets embedded is the @DocumentId.
Now that I've read the Hibernate Search documentation a bit more, I think using @IndexedEmbedded(includePaths ={"id"}) would do the same thing as @SearchableReference. Unfortunately, "includePaths" is new with Hibernate Search 4, and we're still using Hibernate 3.
- Jasen.