gpt4 book ai didi

grails - 关于 grails 可搜索插件的更多信息

转载 作者:行者123 更新时间:2023-12-02 15:39:42 26 4
gpt4 key购买 nike

我有两个简单的域:

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"
}
}

我是可搜索插件的新手,但我相信它可以帮助我解决问题。
因此,任务是按城市查找酒店,然后 按名称排序结果 .如果不进行排序,可以使用动态查找器帮助轻松完成,但是......

摘要:
  • 按城市查找酒店。
  • 按酒店名称排序结果(对于给定的语言)。
  • 支持分页。
  • 最佳答案

    公共(public)类酒店{

    static searchable = {
    hotelTexts component: true
    }

    ...

    }

    公共(public)类 HotelText {
    静态可搜索 = {
    名称提升:2.0
    }
    ...

    }

    关于grails - 关于 grails 可搜索插件的更多信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2463403/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com