[hibernate-dev] [Search] Regression with @ContainedIn between 4.3 and 4.4

Guillaume Smet guillaume.smet at gmail.com
Thu Mar 27 09:46:20 EDT 2014


Hi Hardy,

On Thu, Mar 27, 2014 at 12:52 PM, Hardy Ferentschik <hardy at hibernate.org> wrote:
> I think an example/test would be awesome. Then we have some concrete example
> to base our discussion upon.

I don't think a test would be useful to understand what we do. Here
are a few additional information about our business case.

The fact is that we have complex business rules which requires us to
reindex entities when we change/index one even if they don't have an
@IndexedEmbedded relation.

You're right about having specific fieldbridges but we also have the
case when we want to index the results of a transient method on a
dependency of the object.

In one of our (many) examples of this usage, we have:
ProductModel
     @ContainedIn
     Set<ProductArticle> articles;

ProductArticle doesn't have an @IndexedEmbedded annotation on its
ProductModel field because we don't use this feature to index it. But
when we reindex a ProductModel, we need to reindex the articles.

Moreover, an article might have a ShootingBrief and when we change the
ProductModel, we also want to reindex the ShootingBriefs of the
ProductArticles as they have a field which depends on a ProductModel
property.

This field is the result of a transient method. Not an @IndexedEmbedded thing.

Using @ContainedIn as we do allows us to build a dependency graph of
indexing. And this dependency graph exists even if we don't use
@IndexedEmbedded but other Search features (FieldBridges, @Field on a
transient method...).

Note that it worked perfectly until 4.4.

I don't know if it's more clear with these information. Feel free to
ping me on IRC to discuss it further if needed.

-- 
Guillaume


More information about the hibernate-dev mailing list