如果要删除数据,确保服务已经停止的前提下,通过如下方式
代码语言:javascript复制[root@h102 solr-5.3.0]# rm -Rf example/cloud/
[root@h102 solr-5.3.0]# tree example/cloud/
example/cloud/ [error opening dir]
0 directories, 0 files
[root@h102 solr-5.3.0]#
总结
- Launched Solr into SolrCloud mode, two nodes, two collections including shards and replicas
- Indexed a directory of rich text files
- Indexed Solr XML files
- Indexed Solr JSON files
- Indexed CSV content
- Opened the admin console, used its query interface to get JSON formatted results
- Opened the /browse interface to explore Solr’s features in a more friendly and familiar interface
命令汇总
java -version
tar -zxvf solr-5.3.0.tgz
cd solr-5.3.0
bin/solr start -e cloud -noprompt
bin/post -h
bin/post -c gettingstarted docs/
bin/post -c gettingstarted example/exampledocs/*.xml
bin/post -c gettingstarted example/exampledocs/books.json
bin/post -c gettingstarted example/exampledocs/books.csv
bin/post -c gettingstarted -d "<delete><id>/data/solr/solr-5.3.0/docs/quickstart.html</id></delete>"
curl "http://192.168.100.102:7574/solr/gettingstarted_shard1_replica1/select?q=*:*&wt=json&indent=true"
curl "http://localhost:8983/solr/gettingstarted/select?wt=json&indent=true&q=foundation"
curl "http://localhost:8983/solr/gettingstarted/select?wt=json&indent=true&q=foundation&fl=id&start=30&rows=5"
curl "http://localhost:8983/solr/gettingstarted/select?wt=json&indent=true&q=_version_:1511824568810995712"
curl "http://localhost:8983/solr/gettingstarted/select?wt=json&indent=true&fl=id&rows=3&q=test"
curl "http://localhost:8983/solr/gettingstarted/select?wt=json&indent=true&fl=id&rows=3&q=ui"
curl "http://localhost:8983/solr/gettingstarted/select?wt=json&indent=true&fl=id&rows=3&q=ui test"
curl "http://localhost:8983/solr/gettingstarted/select?wt=json&indent=true&fl=id&rows=3&q=+one +three"
curl "http://localhost:8983/solr/gettingstarted/select?wt=json&indent=true&fl=id&rows=3&q=+two -three"
curl "http://192.168.100.102:7574/solr/gettingstarted_shard1_replica1/select?q=*:*&wt=json&indent=true&rows=0&facet=true&facet.field=stream_size"
curl "http://192.168.100.102:7574/solr/gettingstarted_shard1_replica1/select?q=*:*&wt=json&indent=true&rows=0&facet=true&facet.range=stream_size&f.stream_size.facet.range.start=0&&f.stream_size.facet.range.end=9000&f.stream_size.facet.range.gap=1000&facet.range.other=after"
curl "http://localhost:8983/solr/gettingstarted/select?q=*:*&rows=0&wt=json&indent=on&facet=on&facet.pivot=stream_size,title"
bin/solr stop -all
netstat -ant | grep -E '(8983|7574)'
tree example/cloud/
附
使用下面的脚本可以快速的准备出试验环境
代码语言:javascript复制date ;
bin/solr start -e cloud -noprompt ;
open http://localhost:8983/solr ;
bin/post -c gettingstarted docs/ ;
open http://localhost:8983/solr/gettingstarted/browse ;
bin/post -c gettingstarted example/exampledocs/*.xml ;
bin/post -c gettingstarted example/exampledocs/books.json ;
bin/post -c gettingstarted example/exampledocs/books.csv ;
bin/post -c gettingstarted -d "<delete><id>SP2514N</id></delete>" ;
bin/solr healthcheck -c gettingstarted ;
date ;
原文地址