grails searcheable plugin search in inner hasMany class

别说谁变了你拦得住时间么 提交于 2019-12-06 14:48:16

try to configure comments as component:

class News {
  static searchable = true
  static hasMany = [comments: Comment]
  String text
  static searchable = {
    comments component: [prefix:'comment']
  }
}

This allows you to search for a specific comments through News.search("componenttext:phrase", params), but afaik, News.search("a phrase", params) will also search through the comments.

btw: have you already discovered luke? http://code.google.com/p/luke/ This tool will help you a lot while working with the lucene index. For instance, it shows you how lucene sees you grails domain class.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!