grails-hibernate-search-plugin icon indicating copy to clipboard operation
grails-hibernate-search-plugin copied to clipboard

DocumentId not implicitly defined when using annotations

Open dusura opened this issue 13 years ago • 2 comments

To get annotations to work you have to explicitly define an id field in your domain class and annotate it with @DocumentId. Otherwise you get a SearchException "No document id".

It would be nice if this wasn't necessary.

Also, the documentation implies that the explicit id is not necessary. This is not so.

dusura avatar Mar 23 '12 01:03 dusura

I am aware of this problem. This is one reason why the plugin provides a declarative DSL for defining indexed fields within domain classes

    static search = { ... }

I totally forgot to report it in the documentation, I'll fix this.

I don't have yet any solution to omit DocumentId, I let the bug open.

mathpere avatar Apr 02 '12 22:04 mathpere

Hi Mathieu,

thanks for your reply. I switched from declarative DSL to annotations recently. I had some problems with the DSL and class hierarchies though I can remember the exact issue. So I think annotations is the only option for me at the moment.

dusura avatar Apr 02 '12 23:04 dusura