码迷,mamicode.com
首页 > 其他好文 > 详细

Solr 4 Study notes (part1)

时间:2014-09-18 19:06:45      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:searchengine   solr   

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:

_version_  field

<field name=”_version_” type=”long” indexed=”true”stored=”true” multiValued=”false”/>

 

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

 

 

 


Solr 4 Study notes (part1)

标签:searchengine   solr   

原文地址:http://shadowisper.blog.51cto.com/3189863/1554847

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!