Hide Forgot
This applies to all examples, but I first found the problem in Example 2.5 Using @AnalyzerDef and the Solr Framework to Define and Use an Analyzer Describe the issue: The example domain objects should never have any of these annotations: - @Entity - @GeneratedValue - @DocumentId - @Id - @ManyToMany - @ManyToOne - @OneToMany Also: = the attributes usually annotated via @Id or @DocumentId need to be completely removed (not just the annotation). = all example domain objects must implement Serializable Suggestions for improvement: For example the code for example 2.5 should be: @Indexed @AnalyzerDef( name = "customanalyzer", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class), filters = { @TokenFilterDef(factory = LowerCaseFilterFactory.class), @TokenFilterDef(factory = SnowballPorterFilterFactory.class, params = { @Parameter(name = "language", value = "English") }) }) public class Book implements Serializable { @Field @Analyzer(definition = "customanalyzer") private String title; @Field @Analyzer(definition = "customanalyzer") private String subtitle; @IndexedEmbedded private Set authors = new HashSet(); @Field(index = Index.YES, analyze = Analyze.NO, store = Store.YES) @DateBridge(resolution = Resolution.DAY) private Date publicationDate; public Book() { } // standard getters/setters follow here ... } Finally, please take particular care with necessary vertical alignment in code. I realize it's not usually fundamental in text, but developers are particularly sensitive to finding it very disturbing.
WIP
The particular code snippet mentioned by Sanne is now fixed as he suggested, but there are several others that need the same treatment regarding the use of @Id and @DocumentId annotations (which are meaningless in the Infinispan Query context and should be removed). How can I help? I can convert the other code snippets, but not sure it's wise to open another dozen of bugzillas for them. Can I do the corrections somehow directly in the document?
Directly related to this issue: there is a section "4.1.1.4. @Id" which should be removed. Instead we should add a section stating that @Id, @DocumentId, @Entity, etc (mentioned earlier by Sanne) are not useable in the context of JDG Query. A similar section exists in Infinispan Query user guide: http://infinispan.org/docs/6.0.x/user_guide/user_guide.html#_notable_differences_with_hibernate_search
Please ignore my comment #4 and #5, it seems I somehow switched to the Hibernate Search guide, not the 'Infinispan Query Guide'. Too many browser tabs open. So yes, this is fixed and can be closed.
Thanks very much, Adrian!
The fix for this bug is now generally released and available here: https://access.redhat.com/site/documentation/en-US/Red_Hat_JBoss_Data_Grid/6.2/index.html