0

私は2つの単純なドメインを持っています:

public class Hotel {
 static searchable = true
 Source source
 City city
 HotelType type
 long sourceid
 float lat
 float lon
 static hasMany = [hotelTexts:HotelText]
 static mapping = {
  hotelTexts batchSize:10
  }
}

public class HotelText {
    static searchable = true
    static belongsTo = [hotel:Hotel]
    String lang
    String name
    String description
    String address
    static mapping = {
        batchSize:10
        description type:"text"
    }
}

私は検索可能なプラグインにまったく慣れていませんが、それが私の問題を解決するのに役立つと信じています。したがって、タスクは都市でホテルを検索し、名前で結果を並べ替えることです。並べ替えなしで、動的ファインダーの助けを借りて簡単に行うことができますが...

概要:

  1. 都市別にホテルを検索します。
  2. 結果をホテル名(特定の言語)で並べ替えます。
  3. ページネーションをサポートします。
4

1 に答える 1

1

パブリッククラスホテル{

static searchable = {
     hotelTexts component: true
}

...

}

public class HotelText {static searchable = {name boost:2.0}

...

}

于 2010-06-18T08:13:47.810 に答える