Tag Archives: Solr

Solr useful commands

Useful links:

start/stop server:

bin/solr start
bin/solr start -f
bin/solr start -cloud
bin/solr restart
bin/solr -e techproducts
bin/solr stop
bin/solr status

 

manage cores:

bin/solr create -c <core>
bin/solr delete -c <core>

delete all:

http://host:port/solr/<core>/update?stream.body=*:*&commit=true

post document:

java -Dc=<core> -jar post.jar blabla.xml
bin/post -c <core> example/exampledocs/*.xml

query documents:

see also:

http://localhost:8983/solr/<core>/select?q=videoquery documents with field selection:
http://localhost:8983/solr/<core>/select?q=video&fl=id,name,price

query a specific field

http://localhost:8983/solr/<core>/select?q=firstname:bob

query a range

http://localhost:8983/solr/<core>/select?q=price:0%20TO%20100&fl=id,name,price

format query response output

  • json:
http://localhost:8983/solr/<core>/select?q=firstname:bob
  • xml:
http://localhost:8983/solr/<core>/select?q=firstname:bob&wt=xml
  • csv:
http://localhost:8983/solr/<core>/select?q=firstname:bob&wt=csv

 

a