- solrcloud 上传文件
D:\solr-6.2.1>.\server\scripts\cloud-scripts\zkcli.bat -cmd putfile /configs/gettingstarted/xslt/updateXml.xsl example\example-DIH\solr\solr\conf\xslt\updateXml.xsl -zkhost localhost:9983
2.solrcloud创建目录
D:\solr-6.2.1>.\server\scripts\cloud-scripts\zkcli.bat -cmd makepath /configs/gettingstarted/xslt/ -zkhost localhost:9983
3.solr 变相导出数据,生成update的xml格式数据
原理是:solr支持搜索出来的数据可以转化成update时的xml格式,需要定义XSLT stylesheet ,默认是conf/xslt/updateXml.xsl
http://localhost:8983/solr/my_collection/select?q=*:*&wt=xslt&tr=updateXml.xsl&rows=1000
逆向操作:
curl "http://localhost:8983/solr/my_collection/update?commit=true&tr=updateXml.xsl" -H "Content-Type: text/xml" --data-binary @myexporteddata.xml
4
curl -X POST -H 'Content-type:application/json' --data-binary '{"add-field" : {"name":"digest", "type":"string","stored":true,"indexed":false}}' http://172.18.40.16:8983/solr/nutchdata/schema
bin/nutch generate -D mapred.reduce.tasks=2 -D mapred.child.java.opts=-Xmx1000m -D mapred.reduce.tasks.speculative.execution=false -D mapred.map.tasks.speculative.execution=false -D mapred.compress.map.output=true -topN 5000 -noNorm -noFilter -adddays 0 -crawlId dog -batchId 1478079946-9309
bin/nutch fetch -D mapred.reduce.tasks=2 -D mapred.child.java.opts=-Xmx1000m -D mapred.reduce.tasks.speculative.execution=false -D mapred.map.tasks.speculative.execution=false -D mapred.compress.map.output=true -D fetcher.timelimit.mins=180 1478508725-4707 -crawlId dog -threads 5
bin/nutch parse -D mapred.reduce.tasks=2 -D mapred.child.java.opts=-Xmx1000m -D mapred.reduce.tasks.speculative.execution=false -D mapred.map.tasks.speculative.execution=false -D mapred.compress.map.output=true -D mapred.skip.attempts.to.start.skipping=2 -D mapred.skip.map.max.skip.records=1 1478073631-2744 -crawlId dog
bin/nutch index -D mapred.reduce.tasks=2 -D mapred.child.java.opts=-Xmx1000m -D mapred.reduce.tasks.speculative.execution=false -D mapred.map.tasks.speculative.execution=false -D mapred.compress.map.output=true -D solr.server.url=http://172.18.40.16:8983/solr/gettingstarted/ 1478073631-2744 -crawlId dog
bin/nutch solrdedup -D mapred.reduce.tasks=2 -D mapred.child.java.opts=-Xmx1000m -D mapred.reduce.tasks.speculative.execution=false -D mapred.map.tasks.speculative.execution=false -D mapred.compress.map.output=true http://172.18.40.16:8983/solr/gettingstarted/
bin/post -url https://localhost:8983/solr/mycollection/update -d "<delete><query>*:*</query></delete>"
"tstamp":"1970-01-01T00:00:00Z"
solr 创建可扩展shard的collection
构建索引时添加字段”-route-“=shardname
下划线
http://localhost:8983/solr/admin/collections?action=CREATE&collection.configName=myconf&maxShardsPerNode=100&name=mycloud&replicationFactor=2&router.name=implicit&routerName=implicit&wt=json&shards=shard1,shard2,shard3&route.field=word
http://localhost:8983/solr/admin/collections?action=CREATESHARD&collection=mycloud&shard=shard6&collection.configName=myconf
http://localhost:8983/solr/admin/collections?action=DELETE&name=mycloud