前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Solr基础操作16

Solr基础操作16

作者头像
franket
发布2022-06-29 22:40:38
1910
发布2022-06-29 22:40:38
举报
文章被收录于专栏:技术杂记

如果要删除数据,确保服务已经停止的前提下,通过如下方式

代码语言: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=*%3A*&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=%2Bone+%2Bthree"
  • curl "http://localhost:8983/solr/gettingstarted/select?wt=json&indent=true&fl=id&rows=3&q=%2Btwo+-three"
  • curl "http://192.168.100.102:7574/solr/gettingstarted_shard1_replica1/select?q=*%3A*&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=*%3A*&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 ;

原文地址

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 总结
  • 命令汇总
相关产品与服务
命令行工具
腾讯云命令行工具 TCCLI 是管理腾讯云资源的统一工具。使用腾讯云命令行工具,您可以快速调用腾讯云 API 来管理您的腾讯云资源。此外,您还可以基于腾讯云的命令行工具来做自动化和脚本处理,以更多样的方式进行组合和重用。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档