[jboss-user] [JBoss Seam] - Re: Seam/hibernate search

christian.bauer@jboss.com do-not-reply at jboss.com
Thu Aug 16 22:19:58 EDT 2007


But Lucene has its own QueryParser already, why would we write another syntax and another parser? Yes, it is not very stable and throws exceptions all the time (fun on JIRA which uses it). I see more chance improving the Lucene criteria API though by abstracting it a little. For example:


  | @org.hibernate.search.annotations.Indexed
  | @Entity
  | @Searchable(description = "Documents")
  | public class Document {
  | 
  |     @org.hibernate.search.annotations.Field(index = org.hibernate.search.annotations.Index.TOKENIZED)
  |     @Searchable(description = "Content")
  |     private String content;
  | 
  |     @org.hibernate.search.annotations.Field(
  |         index = org.hibernate.search.annotations.Index.UN_TOKENIZED,
  |         store = org.hibernate.search.annotations.Store.YES
  |     )
  |     @org.hibernate.search.annotations.DateBridge(resolution = org.hibernate.search.annotations.Resolution.DAY)
  |     @Searchable(description = "Modified", type = SearchableType.PASTDATE)
  |     protected Date lastModifiedOn;
  | 
  | }
  | 

The @Searchable annotation is mine. With this I can:

- build an internal metamodel of searchable entities and properties

- build a UI from this metamodel (I have the description text)

- generate a compound Lucene query with AND/OR semantics (depending on users choice) from the UI input, using some generic value holders to transport the search strings

I think this can be made generic enough to justify inclusion in Hibernate Search and Seam (for the UI part).


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4075057#4075057

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4075057



More information about the jboss-user mailing list