snowdrop / spring-data-snowdrop

Spring Data implementation for Hibernate Search, JPA (full-text), Infinispan, GAE, ...
Apache License 2.0
5 stars 4 forks source link

Test more complex mappings #3

Closed yrodiere closed 7 years ago

yrodiere commented 7 years ago

Revert the last commit to enable the tests.

Currently none of the tests pass, and I think it's mostly related to the fact we use Class metadata instead of Hibernate Search metadata to detect field types.

One solution would be to use Hibernate Search metamodel (org.hibernate.search.spi.SearchIntegrator#getIndexedTypeDescriptor), but:

  1. This metamodel doesn't include bridge-defined fields
  2. We wouldn't cover the case of fully dynamic fields (fields added at runtime, but not declared in the schema).

So we may want to remove bootstrap-time metamodel checks altogether... I'd wager some other integrations already do that.

alesj commented 7 years ago

Atm I added property --> field mapping. But dunno what to do if there are multiple fields.

Changing the query parsing logic is almost impossible. And, imo, it's more natural to map your queries against properties and not against fields. As field names should be impl detail, whereas entity property is what the user sees / uses.

I'll merge this. And we can open up new PR, after we decide what to do with multi-fields and runtime-fields.