windows下使用solr--安裝

1.分別下載jetty-6.0.2和solr-3.6.1
http://mirror.mel.bkb.net.au/pub/apache/lucene/solr/3.6.1/apache-solr-3.6.1.tgz
java

http://dist.codehaus.org/jetty/jetty-6.0.x/jetty-6.0.2.zip
2.安裝jetty
解壓jetty-6.0.2至E:\Program Files\jetty6。
解壓apache-solr-3.6.1\dist\apache-solr-3.6.1.war 從新命名爲solr,並將solr放入E:\Program Files\jetty6\webapps目錄下 。
將apache-solr-3.6.1\example\solr拷貝至E:\Program Files\jetty6\webapps\solr目錄下並從新命名爲bbs
3.將E:\Program Files\jetty6\webapps\solr\bbs\solr.xml移動到上一級目錄,即E:\Program Files\jetty6\webapps\solr\目錄下
內容修改以下:
web

<?xml version="1.0" encoding="UTF-8" ?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<!--
   This is an example of a simple "solr.xml" file for configuring one or 
   more Solr Cores, as well as allowing Cores to be added, removed, and 
   reloaded via HTTP requests.

   More information about options available in this configuration file, 
   and Solr Core administration can be found online:
   http://wiki.apache.org/solr/CoreAdmin
-->

<!--
 All (relative) paths are relative to the installation path
  
  persistent: Save changes made via the API to this file
  sharedLib: path to a lib directory that will be shared across all cores
-->
<solr persistent="false">

  <!--
  adminPath: RequestHandler path to manage cores.  
    If 'null' (or absent), cores will not be manageable via request handler
  -->
  <cores adminPath="/admin/cores">
    <core name="bbs" instanceDir="bbs" />
  </cores>
</solr>

修改bbs\conf\schema.xml對應的name爲bbs
修改bbs\conf\solrconfig.xml裏索引數據存放的位置爲<dataDir>${solr.data.dir:F:\solr\bbs}</dataDir> 
4.啓動jetty
cmd進入 E:\Program Files\jetty6 目錄,執行
java -Dsolr.solr.home="E:\Program Files\jetty6\webapps\solr" -jar start.jar

而後在瀏覽器裏輸入 http://localhost:8080/solr/,你會看到Admin_bbs了,而且在bbs接口數據文件f:\solr\bbs下生成index和spellchecker兩個文件夾
Admin_bbs

相關文章
相關標籤/搜索