Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 401657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:03:14+00:00 2026-05-12T17:03:14+00:00

For my Grails App i use Searchable Plugin to have an nice google-like Search.

  • 0

For my Grails App i use Searchable Plugin to have an nice “google-like” Search.

I followed instructions and added:

class Address {
    static searchable =true

    Integer id                  
    AddressGroups addressType   
    String briefDescription     
    String company 
}  

It really works fine.
The Problem here is that the Searchbar in my App is searching through all Classes.

I know it is a simple Problem. But i found no Documentation for that issue. I just want to search one domain class at time. Not all classes.

More Information:
Additionally i got an User Class and an AddressGroups Class.
As you can see Addressgroups provides addressType for Address.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:03:15+00:00Added an answer on May 12, 2026 at 5:03 pm

    to only search for results of one type you can add an additional search term “alias:DomainClassName” (this has to be anded to the normal query)
    so it becomes

    (searchterm) AND (alias:DomainClassName)

    if you want the Person as a result if the term is found in the addressGroups you could define addressGroups as a component and make the addressgroups a non-root object for compass.

    class Person {
        AdressGroups addressType
        static searchable = {
            root true
            addressType component: [prefix:'person_']
        }
    }
    class AdressGroups {
        static searchable = {
            root false
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My current requirement is: I have to package my grails app and use teamcity
I have inherited a Grails app, which uses the Acegi 0.5.3 plugin. The application
I have a grails 1.2 app and I want to use declarative security in
I currently have a Grails application I'm evaluating to port to Google App Engine
In my Grails app, I'm using the Searchable plugin for searching/indexing. I want to
I have a grails app with a domain Restaurant and a domain Person. class
I have a grails app that uses the Spring-Security-Core plugin, which integrates Spring Security
I use the Grails CloudFoundry plugin to deploy my Grails app. Almost as soon
I have a grails app that is using jsecurity plugin for authentication. How do
I have a Grails app that loads its data from xml files and delivers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.