|
首页>相关研究方向>lucene/nutch> |
Grails的全文检索插件 |
|
Visited times , Welcome to Data Mining Forum & Data Mining Expert |
|
|
Searchable Plugin
The Searchable Plugin aims to provide rich search features to Grails applications with minimum effort, and still give you power and flexibility when you need it.
It is built on the fantastic Compass Search Engine Framework and Lucene and has the same license as Grails (Apache 2).
The roadmap and issues are tracked in JIRA.
Intially the plugin will focus on exposing Groovy domain models.
Support for Java domain classes is on the roadmap but until then, if your Grails application uses Java domain classes, using Compass's native annotations or XML mapping config and setting up Compass yourself may be a better fit at this stage.
Features
The plugin:
* Detects searchable classes and maps them to the search index * Performs a bulk index of all searchable class instances in the database * Automatically synchronises any changes made through GORM/hibernate with the index 数据挖掘论坛 * Adds domain class methods for easy class-based searching and index management * Provides a {{SearchableService}} for easy application-wide searching and index management * Provides a {{SearchableController}} for testing queries and demonstrating the Searchable Plugin API * Provides a configuration mechanism to enable/disable features and override default behavoir if necessary
Quick start
Install the plugin
grails install-plugin searchable
Define Searchable classes
Add a static searchable property in the domain classes you need to be searchable, for example:
/** * A blog post */ class Post { static searchable = true // maps and indexes Post instances with default rules static hasMany = [comments: Comment] // Comment could also be "searchable" In order to get a many to one mapping to index correctly additional steps are required. Following this link http://www.nabble.com/Searchable-plugin-problem-td17573290.html 数据挖掘论坛 User author // User could also be "searchable" String category, title, post Date postDate }
(_There are more ways to map your classes to the search index, but this is enough for now._)
Try it!
Fire up your app… _during startup the plugin will build the search index all for searchable class instances in your database_.
Navigate to http://localhost:8080/YOUR-APP-NAME-HERE/searchable, and try a few queries. Here's a screenshot from my own app:
|
| 上一页12 下一页 |
|
|
|
[数据挖掘专家]
[数据挖掘研究院]
[数据挖掘论坛]
[数据挖掘实验室]
|
上一篇:J2EE Search的增删查改及检索初步实现
下一篇:Lucene 基础指南(Java版)
|
|
|
|