TaackSearchService (taack-ui 0.3.8 API)
Package: taack.base

[Groovy] Class TaackSearchService

    • taack.base.TaackSearchService
    • All Implemented Interfaces and Traits:
      grails.web.api.WebAttributes


      @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 MethodClosure, this.&labeling as MethodClosure, { 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
                ))
            }
      Override:
      List indexThose(Class toIndex) { if (toIndex.isAssignableFrom(Ticket2Issue)) return Ticket2Issue.findAllByActive(true) else null } }

      • Nested Class Summary

          Nested classes 
          Modifiers Name Description
          interface  TaackSearchService.IIndexService Service interface allowing an application module to index its domain.
      • Methods Summary

      • Inherited Methods Summary

          Inherited Methods 
          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()
      • Property Detail

      • Constructor Detail

        • TaackSearchService()

      • Method Detail

        • final void indexAll()

        • @javax.annotation.PostConstruct void init()

        • final void registerSolrSpecifier(TaackSearchService.IIndexService indexService, SolrSpecifier solrSpecifier)

          Register the way each domain class will be indexed and faceted.

          Parameters:
          indexService - The service
          solrSpecifier - How to index data

        • final UiBlockSpecifier search(java.lang.String q, org.codehaus.groovy.runtime.MethodClosure search, java.lang.Class<? extends org.grails.datastore.gorm.GormEntity>[] classes)