solr是什么?

翻译

SolrTM is the popular, blazing fast open source enterprise search platform from the Apache LuceneTM project. Its major features include powerful full-text search, hit highlighting, faceted search, near real-time indexing, dynamic clustering, database integration, rich document (e.g., Word, PDF) handling, and geospatial search. Solr is highly reliable, scalable and fault tolerant, providing distributed indexing, replication and load-balanced querying, automated failover and recovery, centralized configuration and more. Solr powers the search and navigation features of many of the world's largest internet sites.

Solr is written in Java and runs as a standalone full-text search server within a servlet container such as Jetty. Solr uses the Lucene Java search library at its core for full-text indexing and search, and has REST-like HTTP/XML and JSON APIs that make it easy to use from virtually any programming language. Solr's powerful external configuration allows it to be tailored to almost any type of application without Java coding, and it has an extensive plugin architecture when more advanced customization is required.

See the complete feature list for more details.

solr安装

下载:

http://archive.apache.org/dist/lucene/solr/

最新版本4.6.1

环境需求:

java 1.6版本以上;

solr运行需要java serverlet 容器,默认使用jetty,或者tomcat,jboss等等。

步骤:

1.wget 软件包,wget http://archive.apache.org/dist/lucene/solr/4.6.1/solr-4.6.1.tgz

2.解压, tar zxvf solr-4.6.1.tgz

3.进入到solr-4.6.1/example, 运行java -jar start.jar,这样jetty就监听在8983端口,在浏览器输入ip:8983/solr

side XXXXXXXXX

使用tomcat替代jetty

1.安装好java,安装好tomcat

2.将解压包中的solr-4.6.1/dist/solr-4.6.1.war复制到tomcat_dir/webapps/目录,并命名为solr.war

3.将solr-4.6.1/example/lib/ext/目录下的jar文件复制到tomcat_dir/lib目录下,将solr-4.6.1/example/resources/下的log4j.properties文件复制到tomcat_dir/lib目录下

这一步的目的是解决报错 startInternal SEVERE: Error filterStart,参考http://www.cnblogs.com/hupengcool/archive/2013/05/11/3072573.html

4.修改tomcat_dir/conf/server.xml

    <Connector port="" protocol="HTTP/1.1"
connectionTimeout=""
redirectPort=""
URIEncoding="UTF-8" />

5.创建solr.xml,路径:tomcat_dir/conf/Catalina/localhost/solr.xml,内容:

<Context path="/solr" docBase="/home/app/act/tomcat/apache-tomcat-7.0.47/webapps/solr.war"
debug="" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/home/app/act/solr/example/solr/" override="true" />
</Context>

6.下面是添加solr配置文件,这些文件包括schema.xml,solrconfig.xml等等,这些文件放置在solr/home目录下(实际上实在solr/home/collection1下)。

solr-4.6.1/example/solr/下的目录结构是

.
├── bin
├── collection1
│   ├── conf
│   │   ├── admin-extra.html
│   │   ├── admin-extra.menu-bottom.html
│   │   ├── admin-extra.menu-top.html
│   │   ├── clustering
│   │   │   └── carrot2
│   │   │   ├── kmeans-attributes.xml
│   │   │   ├── lingo-attributes.xml
│   │   │   └── stc-attributes.xml
│   │   ├── currency.xml
│   │   ├── elevate.xml
│   │   ├── lang
│   │   │   ├── contractions_ca.txt
│   │   │   ├── contractions_fr.txt
│   │   │   ├── contractions_ga.txt
│   │   │   ├── stopwords_ca.txt
│   │   │   ├── stopwords_cz.txt
│   │   │   ├── stopwords_da.txt
│   │   ├── mapping-FoldToASCII.txt
│   │   ├── mapping-ISOLatin1Accent.txt
│   │   ├── protwords.txt
│   │   ├── schema.xml
│   │   ├── scripts.conf
│   │   ├── solrconfig.xml
│   │   ├── spellings.txt
│   │   ├── stopwords.txt
│   │   ├── synonyms.txt
│   │   ├── update-script.js
│   │   ├── velocity
│   │   │   ├── browse.vm
│   │   │   ├── cluster_results.vm
│   │   │   ├── cluster.vm
│   │   │   ├── debug.vm
│   │   │   └── VM_global_library.vm
│   │   └── xslt
│   │   ├── example_atom.xsl
│   │   ├── example_rss.xsl
│   │   ├── example.xsl
│   │   ├── luke.xsl
│   │   └── updateXml.xsl
│   ├── core.properties
│   ├── data
│   │   ├── index
│   │   │   ├── _0.fdt
│   │   │   ├── _0.fdx
│   │   │   ├── _0.fnm
│   │   │   ├── _0_Lucene41_0.doc
│   │   │   ├── _0_Lucene41_0.pos
│   │   └── tlog
│   │   └── tlog.
│   └── README.txt
├── README.txt
├── solr.xml
└── zoo.cfg

按照上面可以运行solr。

最新文章

  1. .net学习笔记---tcp/udp/http/socket
  2. [Linux] 学习笔记之安装学习环境(sshd, lrzsz)
  3. Scrapy
  4. UML中类之间的几种关系
  5. 【阿里云产品公测】Opensearch使用体验和评测
  6. Android:Resources资源文件
  7. trigger
  8. MVC-各种传值方式
  9. LinGo:投资问题——线性规划
  10. 使用Canvas实现下雪功能
  11. Knockout应用开发指南 第十章:更多信息(完结篇)
  12. Bootstrap-table事件使用
  13. 《共享库PATH与ld.so.conf简析》
  14. IntelliJ IDEA 导入新项目
  15. 使用commit方式构建具有sshd服务的centos镜像
  16. 设计模式(三)Singleton Pattern单例设计模式
  17. ie67的冷知识
  18. BlockingQueue之DelayQueue的学习使用
  19. Python的生成器进阶玩法
  20. python(57):私有变量,代码块

热门文章

  1. [SHELL]shell中的数学运算
  2. python数据分析基础——pandas Tutorial
  3. Java学习笔记-序
  4. C二维数组行为空,列不为空
  5. 2d命令行小游戏源码
  6. android在程序崩溃时Catch异常并处理
  7. [剑指Offer] 52.正则表达式匹配
  8. ADO.NET中DataSet、DataTable、DataRow的数据复制方法
  9. 【Python】从1&lt;2&lt;3的语法糖说起
  10. 【EF】EF实现大批量数据库插入操作