emmanuel wrote:
you will have to give some more information here.
But generally speaking, if you want to query an entity by some values non present in the database, a class level bridge is the way to go, you inject the related data in the document.
I did not really understand your comment about 2 documents per entity
Without going too much into the business rules, I need to generate two documents from one entity (i.e. the entity will result in two separate index documents). The issue that I'm running into is that Hibernate Search will only call the class bridge once per entity, so it will only ever create one document. Here's some code:
Code:
for (Person person : people)
{
RelationshipName rn = getRelationshipName(person);
if(rn != null)
{
// This should call the class bridge
fullTextEntityManager.index(rn);
}
Person otherPerson = getOtherPerson(person);
rn = getRelationshipName(otherPerson);
if(rn != null)
{
// this should call the class bridge again
fullTextEntityManager.index(rn);
}
}
What I would expect is that it indexes the entity twice. In reality, it only calls the class bridge once per iteration.