@grails.compiler.GrailsCompileStatic final class TaackSearchService extends java.lang.Object implements grails.web.api.WebAttributes
Full text search service support.
To add domain to the search, in a service:
@GrailsCompileStatic
class CrewSearchService implements TaackSearchService.IIndexService {
static lazyInit = false
TaackSearchService taackSearchService
@PostConstruct
private void init() {
taackSearchService.registerSolrSpecifier(this, new SolrSpecifier(User, CrewController.&showUserFromSearch as MC, this.&labeling as MC, { User u ->
u ?= new User()
indexField "User Name (without Accents)", SolrFieldType.TXT_NO_ACCENT, u.username_
indexField "User Name", SolrFieldType.TXT_GENERAL, u.username_
indexField "First Name", SolrFieldType.TXT_NO_ACCENT, u.firstName_
indexField "Last Name", SolrFieldType.TXT_NO_ACCENT, u.lastName_
indexField "Subsidiary", SolrFieldType.POINT_STRING, "mainSubsidiary", true, u.mainSubsidiary?.toString()
indexField "Business Unit", SolrFieldType.POINT_STRING, "businessUnit", true, u.businessUnit?.toString()
indexField "Date Created", SolrFieldType.DATE, 0.5f, true, u.dateCreated_
indexField "User Created", SolrFieldType.POINT_STRING, "userCreated", 0.5f, true, u.userCreated?.username
))
}
Modifiers | Name | Description |
---|---|---|
interface |
TaackSearchService.IIndexService |
Service interface allowing an application module to index its domain. |
Type | Name and description |
---|---|
org.springframework.context.MessageSource |
messageSource |
TaackUiConfiguration |
taackUiConfiguration |
Constructor and description |
---|
TaackSearchService
() |
Type Params | Return Type | Name and description |
---|---|---|
|
final void |
indexAll() |
|
final void |
indexAllOnly(java.lang.String name) |
|
void |
init() |
|
final void |
registerSolrSpecifier(TaackSearchService.IIndexService indexService, SolrSpecifier solrSpecifier) Register the way each domain class will be indexed and faceted. |
|
final UiBlockSpecifier |
search(java.lang.String q, org.codehaus.groovy.runtime.MethodClosure search, java.lang.Class<? extends org.grails.datastore.gorm.GormEntity>[] classes) Build search block |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Register the way each domain class will be indexed and faceted.
indexService
- The servicesolrSpecifier
- How to index dataBuild search block
q
- querysearch
- Action that will display the block (that will call this method)classes
- registered classGroovy Documentation