[hibernate-issues] [Hibernate-JIRA] Created: (HSEARCH-1020) Regression in 3.4: index not updated after updating a collection

Guillaume Smet (JIRA) noreply at atlassian.com
Wed Dec 21 20:01:19 EST 2011


Regression in 3.4: index not updated after updating a collection
----------------------------------------------------------------

                 Key: HSEARCH-1020
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-1020
             Project: Hibernate Search
          Issue Type: Bug
    Affects Versions: 4.0.0.Final, 3.4.1.Final
            Reporter: Guillaume Smet


Hi,

I know it's not exactly documented but, before 3.4, it was possible to index a collection with the @Field annotation and a FieldBridge (in our case, a FieldBridge which indexes all the ids of the linked entities).

We use it a lot instead of @IndexedEmbedded because it allows us not to bloat our index when we want to index a collection containing indexed entities (@IndexedEmbedded integrates all the fields of the linked entities in the index of the main entity - which is often not needed in our case: we have autocomplete field for our search so we only need the id of the linked entities).

Starting with 3.4, it doesn't work anymore: the entity is correctly indexed when created but, if we update only the collection, the index is not updated.

The problem is in AbstractDocumentBuilder.isCollectionRoleExcluded(String collectionRole) which is called to check if the collection update should trigger a reindex. This method should also consider the collections having a @Field annotation, not just the collections with @IndexedEmbedded or @ContainedIn.

FWIW, if somebody else has this problem, as a workaround, I use a non default boost strategy to force the reindex but it would be nice to have it fixed because it's really a useful pattern.

If needed, we can provide a test case.

Thanks.

-- 
Guillaume

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list