Grails Searchable Plugin Search Many Addresses

I have a User domain class that has many-to-many relationships to a class of the LibraryElement class. I am trying to filter out all library items with specific text in it that belong to the user. Here's how to define search properties and relationships:

User side:

static searchable = { id name: 'userId' libraryElements component: true } static hasMany = [libraryElements: LibraryElement] 

Library side:

 static searchable = { users component: true } static belongsTo = User static hasMany = [users: User] 

I am trying to perform a search as follows:

 LibraryElement.search("userId:" + userId + " libraryElementName:" + searchWord + "*") 

I get 0 results, although there is data in the database that should be deleted by this search.

+4
source share
1 answer

Have you tried this:

 LibraryElement.search(searchWord +" AND userId:userId", params) 

?

0
source

All Articles