1

So, I was able to get solr running.

If I run: .\solr-8.3.0\bin>solr status I get:

Found Solr process 114580 running on port 8983
{
  "solr_home":".\\exe\\solr-8.3.0\\server\\solr",
  "version":"8.3.0 2aa586909b911e66e1d8863aa89f173d69f86cd2 - ishan - 2019-10-25 23:15:22",
  "startTime":"2019-11-06T20:45:00.322Z",
  "uptime":"0 days, 1 hours, 8 minutes, 37 seconds",
  "memory":"229.4 MB (%44.8) of 512 MB"}

When I try to make my first core:

solr-8.3.0\bin> solr create -c testCore

I get

The system cannot find the batch label specified - parse_create_args

It seems my java is working correctly:

solr-8.3.0\example\exampledocs>java -jar post.jar -h
SimplePostTool version 5.0.0
Usage: java [SystemProperties] -jar post.jar [-h|-] [<file|folder|url|arg> [<file|folder|url|arg>...]]

Supported System Properties and their defaults:
  -Dc=<core/collection>
  -Durl=<base Solr update URL> (overrides -Dc option if specified)
  -Ddata=files|web|args|stdin (default=files)
  -Dtype=<content-type> (default=application/xml)
  -Dhost=<host> (default: localhost)
  -Dport=<port> (default: 8983)
  -Dbasicauth=<user:pass> (sets Basic Authentication credentials)
  -Dauto=yes|no (default=no)
  -Drecursive=yes|no|<depth> (default=0)
  -Ddelay=<seconds> (default=0 for files, 10 for web)
  -Dfiletypes=<type>[,<type>,...] (default=xml,json,jsonl,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log)
  -Dparams="<key>=<value>[&<key>=<value>...]" (values must be URL-encoded)
  -Dcommit=yes|no (default=yes)
  -Doptimize=yes|no (default=no)
  -Dout=yes|no (default=no)

This is a simple command line tool for POSTing raw data to a Solr port.
NOTE: Specifying the url/core/collection name is mandatory.
Data can be read from files specified as commandline args,
URLs specified as args, as raw commandline arg strings or via STDIN.
Examples:
  java -Dc=gettingstarted -jar post.jar *.xml
  java -Ddata=args -Dc=gettingstarted -jar post.jar '<delete><id>42</id></delete>'
  java -Ddata=stdin -Dc=gettingstarted -jar post.jar < hd.xml
  java -Ddata=web -Dc=gettingstarted -jar post.jar http://example.com/
  java -Dtype=text/csv -Dc=gettingstarted -jar post.jar *.csv
  java -Dtype=application/json -Dc=gettingstarted -jar post.jar *.json
  java -Durl=http://localhost:8983/solr/techproducts/update/extract -Dparams=literal.id=pdf1 -jar post.jar solr-word.pdf
  java -Dauto -Dc=gettingstarted -jar post.jar *
  java -Dauto -Dc=gettingstarted -Drecursive -jar post.jar afolder
  java -Dauto -Dc=gettingstarted -Dfiletypes=ppt,html -jar post.jar afolder
The options controlled by System Properties include the Solr
URL to POST to, the Content-Type of the data, whether a commit
or optimize should be executed, and whether the response should
be written to STDOUT. If auto=yes the tool will try to set type
automatically from file name. When posting rich documents the
file name will be propagated as "resource.name" and also used
as "literal.id". You may override these or any other request parameter
through the -Dparams property. To do a commit only, use "-" as argument.
The web mode is a simple crawler following links within domain, default delay=10s.
jason m
  • 6,519
  • 20
  • 69
  • 122
  • Within solr's root directory is a file called `README.txt`. In there are samples. What you can see is that they start solr everytime from the solr root directory. Hence I would suggest you `cd..` into solr root, from there start solr via `.\bin\solr.cmd start -p 8984`. – cheffe Nov 07 '19 at 08:50
  • Also issue all other commands via `.\bin\solr.cmd <...>` do not cd into the `bin` directory. I assume that will mess up directory assumptions of the solr scripts. – cheffe Nov 07 '19 at 08:51
  • According to [other sources](https://stackoverflow.com/questions/232651/why-the-system-cannot-find-the-batch-label-specified-is-thrown-even-if-label-e) this can be caused by the `.cmd` script being converted to the wrong line ending format. – MatsLindh Nov 07 '19 at 10:13
  • @cheffe i'll try that. – jason m Nov 07 '19 at 13:55

4 Answers4

2

You can use:

solr create_core -c testCore

This should create your core

Harsha pps
  • 2,012
  • 2
  • 25
  • 35
0

I faced the same issue. Passing the port number at the end of the command fixed it. Try this:

solr create -c testCore -p 8983
Akash
  • 89
  • 5
0

Using version 7.7.x solved these issues.

jason m
  • 6,519
  • 20
  • 69
  • 122
0

So I was running into this issue with the example in Solr 8.3.1 on Windows (specifically with deleting the example collection). I figured I'd paste the solution I got just in case anyone else ends up here.

To create the example use:

java -jar -Dc=techproducts -Dauto -Dport=7333 example\exampledocs\post.jar example\exampledocs\*

To delete the example use:

java -jar -Ddata=args -Dc=techproducts -Dport=7333 example/exampledocs/post.jar '<delete><query>*:*</query></delete>'

(Note that I put the example on port 7333 which isn't default.)

user3684314
  • 707
  • 11
  • 31