关于 grails 可搜索插件的更多信息
我有两个简单的域:
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"
}
}
我是可搜索插件的新手,但我相信它可以帮助我解决我的问题。 因此,任务是按城市查找酒店,然后按名称对结果进行排序。无需排序,借助动态查找器的帮助即可轻松完成,但是...
摘要:
- 按城市查找酒店。
- 按酒店名称(针对给定语言)对结果进行排序。
- 支持分页。
I have two simple domains:
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"
}
}
I'm totally new in searchable plugin but i believe that it could help me with my problem.
So, the task is to find Hotels by city and then sort result by name. Without sorting it could be easily done with dynamic finders help but...
Summary:
- Find hotels by city.
- Sort result by hotel name(for given language).
- Support pagination.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
公共类酒店 {
}
公共类 HotelText {
静态可搜索 = {
名称提升:2.0
}
}
public class Hotel {
}
public class HotelText {
static searchable = {
name boost: 2.0
}
}