-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for fullText query of the index #11
Comments
Hibernate Search does not seem to provide a way to search accross all indexed domain classes unless I am missing something. |
The documentation seems to mention the capability:
My particular use case is to have several types of entities indexed in the system and provide a global search function that crosses all indexed domain classes. |
Ok, I got your point. Of course, it is possible to get your own fullTextSession and use Hibernate Search as explained in the doc: class MyService {
def sessionFactory
def searchAccrossItemAndActor( /* ... */ ) {
def hibernateTemplate = new HibernateTemplate( sessionFactory )
hibernateTemplate.execute( { Session session ->
FullTextSession fullTextSession = Search.getFullTextSession( session )
fullTextQuery = fullTextSession.createFullTextQuery( luceneQuery, Item, Actor )
/* ... */
} as HibernateCallback )
}
}
Currently, the plugin lets you to search for an individual domain class: MyDomainClass.search().list {
// query
} (Which facilitates the same kind of code for a domain class.) Do you think of a particular way the plugin would make it easy? |
Hmm, it's a good question. My initial thinking was something like: FullTextSession.search(DomainClass1, DomainClass2, DomainClass3).list {
// query
} Granted, I was just evaluating the plugin for inclusion in my project so I'm not very familiar with the classes and syntax. Any thoughts? |
The plugin adds search methods to domain classes, but behind the scenes a full-text index is built. Is there a way to easily search across all indexed domain classes - or better, a provided list of domain classes?
The text was updated successfully, but these errors were encountered: