[hibernate-dev] About mapping of @IndexedEmbedded and @DocumentId
Sanne Grinovero
sanne at hibernate.org
Tue Mar 15 13:32:36 EDT 2011
2011/3/15 Emmanuel Bernard <emmanuel at hibernate.org>:
>
> On 15 mars 2011, at 16:43, Sanne Grinovero wrote:
>
>> I guess we should prevent the indexing of ids in secondary elements?
>
> If the associated element is an entity, it's perfectly valid to index its id and query by it
>
> //return all books when the author's id is 2
> "author.id:2"
No doubts on that being valid, but on the actual usefulness of this
being always enabled.
Hibernate Search doesn't strictly need it as it does with the class
and root-entity-id, and in other cases we have an "opt-in" approach
for fields.
I'd expect that users might not even know that they can write such a
query, as I found it surprising. I also suspect that for most people
it's just a pointless waste of resources so I think it should be an
option.
Even if we decide to keep it, I'd propose to disable norms on this field(s).
Cheers,
Sanne
More information about the hibernate-dev
mailing list