solr6.20安装

一:安装jdk1.8


      下载solr的安装目录   https://mirrors.tuna.tsinghua.edu.cn/apache/lucene/solr/6.2.0/solr-6.2.0.zip


       solr的入门文档http://lucene.apache.org/solr/quickstart.html


二:solr到新版本不需要再特别配置tomcat了,在解压目录的bin就可以直接使用

         1 启动:>>solr start -e cloud -noprompt   

                 这里的solr是bin下的cmd文件,start是启动cloud表示使用SolrClound example,noprompt   表示全部使用默认配置。

                 系统内置的example有cloud, dih, schemaless,  or techproducts 这几种。

        2 关闭 >>solr stop -all

        3 帮助solr提供了好几个help,比如:>>solr -help   >>solr create -help

        4,执行1之后就可以在   http://localhost:8983/solr/  看到solr的管理员界面了。

        5,在浏览器点击Collection select,选择其中一个,点击Quary。


三:根据文档http://lucene.apache.org/solr/quickstart.html,导入信息需要post。我在bin目录下看到post在windows7没法使用,后来看到是使用 H:\mysolr\solr-6.2.0\example\exampledocs下的post.jar。

1:使用post

        比如:>>java -Dc=gettingstarted -jar post.jar aa.xml"   这里的aa.xml应该和post.jar在一个目录。默认是xml,如果不是xml,需要指定文件格式>>java -Dtype=application/json -Dc=gettingstarted -jar post.jar b.json

       现在我使用的aa.xml是这样的

==

<add>  
    <doc>  
        <field name="id">1</field>  
        <field name="title">我的测试</field>  
        <field name="url">http://www.baidu.com</field>  
    </doc>  
</add> 

刚开始报错,是因为编码原因,在notepad++中改了一下编码就好了。

       2:在浏览器里面quary试试

      3:java -Dtype=application/json -jar post.jar *.json  批量

==

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值