Solr is a standalone enterprise search server with a web-services like API. You put documents in it (called "indexing") via XML over HTTP. You query it via HTTP GET and receive XML results.
- Advanced Full-Text Search Capabilities
- Optimized for High Volume Web Traffic
- Standards Based Open Interfaces - XML and HTTP
- Comprehensive HTML Administration Interfaces
- Server statistics exposed over JMX for monitoring
- Scalability - Efficient Replication to other Solr Search Servers
- Flexible and Adaptable with XML configuration
- Extensible Plugin Architecture
需要索引的XML里面的字段类型在schema.xml里面有定义
定义solr的schema定义,然后建一个新的solr服务。
用一个后台程序,提取数据库数据生成数据,再通过HTTP协议的web服务,一条数据一条数据的发送给solr。
如果有集群,要注意optimizes和commits 的顺序
官方wiki写的很详细,lz最好先参考一下
http://wiki.apache.org/solr/
大多数的应用程序将数据存储在关系数据库、xml文件中。对这样的数据进行搜索是很常见的应用。所谓的DataImportHandler提供一种可配置的方式向solr导入数据,可以一次全部导入,也可以增量导入。
http://www.nabble.com/Using-DataImportHandler-with-mysql-database-td20425791.html
http://wiki.apache.org/solr/DataImportHandler