AssertionFailure with providedId in embeddeds

Description

This started after integration of apparently, building the SearchFactory started throwing an exception on Infinispan:

Here's the partial mapping for reference:

We have a SearchConfiguration with isIdProvidedImplicit true

Environment

None

Activity

Show:
Yoann Rodière
October 26, 2016, 4:34 PM

Hi ,

Thanks for your report. I could not reproduce the issue with the given mapping. Could you please provide the code for the AddressHS class?
Also, could you confirm the bug is still here with the most recent merges?

If you want to contribute a test case, here's the work I started on the test case: https://github.com/yrodiere/hibernate-search/tree/HSEARCH-2433

Thank you,
Yoann

Yoann Rodière
October 26, 2016, 4:39 PM

Well, from your last edit, it seems it was a typo. Then I guess we need a more extensive mapping, because this mapping doesn't show the issue. Do you think you could provide more?
Other attributes in Address (especially embeddeds) would help, in particular.

Gustavo Fernandes
October 26, 2016, 4:45 PM

Thanks for looking into this, and apologies for the half-baked mappings. You can find the full domain here https://github.com/infinispan/infinispan/tree/master/query/src/test/java/org/infinispan/query/dsl/embedded/testdomain/hsearch

Gustavo Fernandes
October 27, 2016, 10:32 AM

Here's a reproducer:

Yoann Rodière
October 27, 2016, 2:16 PM

Ok, so it seems the bug only happens when building with maven from the command line, never when running the test from inside Eclipse. Probably because of the use of HashMaps in our internal code, which makes the relative order of fields change from one run to another.

Anyway, I think I got the issue: provided IDs were being handled incorrectly for @IndexedEmbeddeds . It turns out it had nothing to do with Elasticsearch after all, and we may currently have issues with the Lucene backend too (for example, provided IDs being erased by an embedded provided ID).
I'll submit a PR soon.

Assignee

Yoann Rodière

Reporter

Gustavo Fernandes

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Major
Configure