Solr 4 Study notes (part1)
2014-09-18 17:32
183 查看
Installation:
Jetty:
Modify solr.xml <?xml version=”1.0”?> <!DOCTYPEConfigure PUBLIC ” -//Jetty//Configurer//EN” http://www.eclipse.org/jetty/configure.dtd> <Configure class=”org.eclipse.jetty.webapp.WebAppContext”> <Set name=”contextPath”>/solr</Set> <Setname=”war”><SystemProperty name=”jetty.home”/>/webapps/solr.war</Set> <Setname=”defaultsDescriptor”><SystemProperty name=”jetty.home”/>/etc/webdefault.xml</Set> <Setname=”tempDirectory”><Property name=”jetty.home” default=”.”/>/temp</Set> </Configure>
Copy solr.xml to <jettyinstallation>/context
Copy jetty.xml, webdefault.xml, logging.properties from <solrdistribution>/etc to <jetty installation>/etc Copy schema.xml, solrconfig.xml, solr.xml etc to<solr.home> directory For multi-core configuration In solr.xml:<solr persistent=”true”> <cores adminPath=”/admin/cores” defaultCoreName=”collection1”> <core name=”collection1”instanceDir=”collection1”/></cores></solr>Copy schema.xml, solrconfig.xml to <solr.home>/<collectiondir>/conf Modify /etc/default/jetty file, add -Dsolr.solr.home=xxx Tomcat:
Change tomcat server.xml: connector’s url encoding toUTF-8<Connector port=”8080” protocol=”HTTP/1.1”connectionTimeout=”20000” redirectPort=”8443”URIEncoding=”UTF-8”/>
Create solr.xml in $TOMCAT_HOME/conf/Catalina/localhost<Context path=”/solr” docBase=”/usr/share/tomcat/webapps/solr.war”debug=”0” crossContext=”true”> <Environment name=”solr/home”type=”java.lang.String” value=”usr/share/solr” override=”true”/></Context>
Copy schema.xml, solrconfig.xml, solr.xml etc to<solr.home> directory For multi-core configuration In solr.xml:<solr persistent=”true”> <cores adminPath=”/admin/cores” defaultCoreName=”collection1”> <core name=”collection1”instanceDir=”collection1”/></cores></solr>Copy schema.xml, solrconfig.xml to <solr.home>/<collectiondir>/conf
Solr cloud requirement:
schema.xml
_version_ field<field name=”_version_” type=”long” indexed=”true”stored=”true” multiValued=”false”/>
solrconfig.xml
solr.ReplicationHandler<requestHandler name=”/replication” class=”solr.ReplicationHandler”/>
solr.RealTimeGetHandler<requestHandler name=”/get” class=”solr.RealTimeGetHandler”> <lstname=”defaults”> <str name=”omitHeader”>true</str></lst></requestHandler><updateLog> <strname=”dir”>${solr.data.dir:}</str></updateLog>
solr.xml<solr persistent=”true”><cores adminPath=”/admin/cores … host=”localhost”hostPort=”xxx” zkClientTimeout=”xxxx”></solr>
Directory Implementation:
<directoryFactory name=”DirectoryFactoryclass=”xxxxxxx”/>
Jetty:
Modify solr.xml <?xml version=”1.0”?> <!DOCTYPEConfigure PUBLIC ” -//Jetty//Configurer//EN” http://www.eclipse.org/jetty/configure.dtd> <Configure class=”org.eclipse.jetty.webapp.WebAppContext”> <Set name=”contextPath”>/solr</Set> <Setname=”war”><SystemProperty name=”jetty.home”/>/webapps/solr.war</Set> <Setname=”defaultsDescriptor”><SystemProperty name=”jetty.home”/>/etc/webdefault.xml</Set> <Setname=”tempDirectory”><Property name=”jetty.home” default=”.”/>/temp</Set> </Configure>
Copy solr.xml to <jettyinstallation>/context
Copy jetty.xml, webdefault.xml, logging.properties from <solrdistribution>/etc to <jetty installation>/etc Copy schema.xml, solrconfig.xml, solr.xml etc to<solr.home> directory For multi-core configuration In solr.xml:<solr persistent=”true”> <cores adminPath=”/admin/cores” defaultCoreName=”collection1”> <core name=”collection1”instanceDir=”collection1”/></cores></solr>Copy schema.xml, solrconfig.xml to <solr.home>/<collectiondir>/conf Modify /etc/default/jetty file, add -Dsolr.solr.home=xxx Tomcat:
Change tomcat server.xml: connector’s url encoding toUTF-8<Connector port=”8080” protocol=”HTTP/1.1”connectionTimeout=”20000” redirectPort=”8443”URIEncoding=”UTF-8”/>
Create solr.xml in $TOMCAT_HOME/conf/Catalina/localhost<Context path=”/solr” docBase=”/usr/share/tomcat/webapps/solr.war”debug=”0” crossContext=”true”> <Environment name=”solr/home”type=”java.lang.String” value=”usr/share/solr” override=”true”/></Context>
Copy schema.xml, solrconfig.xml, solr.xml etc to<solr.home> directory For multi-core configuration In solr.xml:<solr persistent=”true”> <cores adminPath=”/admin/cores” defaultCoreName=”collection1”> <core name=”collection1”instanceDir=”collection1”/></cores></solr>Copy schema.xml, solrconfig.xml to <solr.home>/<collectiondir>/conf
Solr cloud requirement:
schema.xml
_version_ field<field name=”_version_” type=”long” indexed=”true”stored=”true” multiValued=”false”/>
solrconfig.xml
solr.ReplicationHandler<requestHandler name=”/replication” class=”solr.ReplicationHandler”/>
solr.RealTimeGetHandler<requestHandler name=”/get” class=”solr.RealTimeGetHandler”> <lstname=”defaults”> <str name=”omitHeader”>true</str></lst></requestHandler><updateLog> <strname=”dir”>${solr.data.dir:}</str></updateLog>
solr.xml<solr persistent=”true”><cores adminPath=”/admin/cores … host=”localhost”hostPort=”xxx” zkClientTimeout=”xxxx”></solr>
Directory Implementation:
<directoryFactory name=”DirectoryFactoryclass=”xxxxxxx”/>
Solr.StandardDirectoryFactory | Solr make decision on underlining implementation |
Solr.SimpleFSDirectoryFactory | Does not scale well with high number of threads |
Solr.NIOFSDirectoryFactory | Scale well with many threads, but does not work well on Windows |
Solr.MMapDirectoryFactory | Good for 64 bit linux system if near realtime searching is not needed |
Solr.NRTCachingDirectoryFactory | Good for near real-time indexing and searching |
Solr.RAMDirectoryFactory | Entirely in memory and not support replication Used for auto-completion or unit testing |
相关文章推荐
- code generation part1--some OO-related topic! - not completed
- 【solr专题之四】在Tomcat 中部署Solr4.x
- solr学习(5.2)-solrj入门
- part1: ShowIssueCat.aspx.cs
- 【Nutch2.2.1基础教程之2.1】集成Nutch/Hbase/Solr构建搜索引擎之一:安装及运行【单机环境】
- solr安装和配置
- 数据交换=>Windows_Mobile+WCF+Exchange2007 - part1
- solr/solrj之原子更新
- Solr基础学习总结1
- Struts 2 Study Notes (1)
- Solr 5.2.1的安装
- Solr6.6环境安装及core的创建(win7环境)
- 基于Cairngorm的Silverlight开发 - part1
- 分布式solr-cloud之zookeeper部署
- solr集群搭建
- 【转】zlib 与 libpng 的配置与使用 part1
- 智能提示(一) Solr (suggest)
- 【Solr】--简介
- WinCE 开发问题精华集锦 Part1
- Solr之SolrCloud高亮查询