Showing posts with label SimplePostTool. Show all posts
Showing posts with label SimplePostTool. Show all posts

Saturday, September 3, 2016

Running Solr on Windows with SimplePostTool

This tutorial covers Java 1.8.0_101 and Apache Solr 5.5.2 on Windows.
Your PATH variable will not be changed. I used full path to cmd/jar file.
I also didn't use Claspath.

c:\Users\UserName\Documents\solr-5.5.2>c:\Users\UserName\Documents\solr-5.5.2\bin\solr.cmd version
5.5.2

c:\Users\UserName\Documents\solr-5.5.2>c:\Users\UserName\Documents\solr-5.5.2\bin\solr.cmd start
Waiting up to 30 to see Solr running on port 8983
Started Solr server on port 8983. Happy searching!

c:\Users\UserName\Documents\solr-5.5.2>c:\Users\UserName\Documents\solr-5.5.2\bin\solr.cmd create -c texas

Copying configuration to new core instance directory:
c:\Users\UserName\Documents\solr-5.5.2\server\solr\texas

Creating new core 'texas' using command:
http://localhost:8983/solr/admin/cores?action=CREATE&name=texas&instanceDir=texas

{
  "responseHeader":{
    "status":0,
    "QTime":10199},
  "core":"texas"}

c:\Users\UserName\Documents\solr-5.5.2>java -jar example/exampledocs/post.jar -h

c:\Users\UserName\Documents\solr-5.5.2>java -Dtype=text/csv -Dc=texas -jar example/exampledocs/post.jar *.csv

c:\Users\UserName\Documents\solr-5.5.2>java -Dauto -Dc=texas -jar example/exampledocs/post.jar fajlovi

c:\Users\UserName\Documents\solr-5.5.2>java -Ddata=web -Dfiletypes=html -Dc=texas -jar example/exampledocs/post.jar http://example.com

More from official docs https://cwiki.apache.org/confluence/display/solr/The+Standard+Query+Parser
proximity search
  • "lorem amet"~20
search JSON document
  • id:978-1423103349
  • also see image
  • cat:book OR text:hardcover

Solr filters and query


Delete all indexed documents

$ curl localhost:8983/solr/texas/update -H "Content-type: text/xml" --data-binary '*:*'
$ curl localhost:8983/solr/texas/update -H "Content-type: text/xml" --data-binary ''

Stop Solr server

c:\Users\UserName\Documents\solr-5.5.2>c:\Users\UserName\Documents\solr-5.5.2\bin\solr.cmd stop -all
Stopping Solr process 5228 running on port 8983

Waiting for 0 seconds, press a key to continue ...