grails searchable with query builder can't find entity

168 views Asked by At

Using searchable plugin with grails 2.3.4 and a postgreSql datasource. The plugin can't render the result when i build a query with a closure:

1) Having a domain Test:

import org.compass.annotations.*

class Test implements Serializable {
    static searchable = true

    @SearchableProperty
    Currency currency

    @SearchableProperty
    String type

2) A service which wires searchableService:

class SearchService {

    def searchableService

    def mysearch() {
       def results = Test.search{
           must(term('type', 'OFFICES'))
           term('currency', 'USD')
       }
       return results
    }

In spite of the well recorded Test entity with string values 'OFFICES' and 'USD' for type and currency properties, the query builder can't find any result...

0

There are 0 answers