有机肥

绿色

solr常用命令

查看帮助
bin/solr -help     
        可以看到solr有哪些子命令,如 start, stop, restart, status, healthcheck, create, create_core, create_collection, delete, version
启动start
bin/solr start  -help    查看start帮助
bin/solr start        启动单机版
bin/solr start -f           前台启动
bin/solr start -p 8984        指定端口启动
bin/solr start -cloud        启动分布式版本
bin/solr start -e cloud -noprompt         -e表示要启动一个现有的例子,例子名称是cloud,cloud这个例子是以SolrCloud方式启动的
bin/solr restart          重启项目

create
如果是单机版要创建core,如果是分布式的要创建collection
bin/solr create -help     查看create帮助
bin/solr create -c abc
        abc是core或collection的名字,取决于solr是单机版还是cloud版本;刷新http://localhost:8983/solr ,可以看到core selector中多了一个abc
        abc目录的位置创建在solr.solr.home(默认是solr的server/solr目录目录下

post提交数据生成索引
bin/post -c abc docs/
        向名为abccore或collection提交数据,数据源在docs/目录中

删除
bin/solr delete -c abc     删除一个core或collection

删除索引
bin/post -c abc  -d "<delete><id>/home/matthewi/software/solr-5.4.1/docs/solr-morphlines-core/allclasses-noframe.html</id></delete>"
重新执行上面的搜索可以看到搜索结果的数量少了一条:numFound列

bin/post -c abc -d "<delete><query>*:*</query></delete>"
删除所有数据

停止solr
bin/solr stop -all

状态
bin/solr status

posted on 2017-08-08 17:28 有机肥 阅读(132) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 
<2017年8月>
303112345
6789101112
13141516171819
20212223242526
272829303112
3456789

导航

统计

常用链接

留言簿

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜