user3541711
user3541711

Reputation: 95

SimplePosttool: FATAL: specifying either url or core/collection is mandatory

I'm new in solr and I want to start an example that is in the exampledocs folder , but when I try to start it using the windows prompt I have the error message in the title. Someone can help me?

Upvotes: 7

Views: 4536

Answers (5)

Rahul Darade
Rahul Darade

Reputation: 51

Start your Solr Admin

Create one core using following command:

solr create -c <name>

Select core from core_selector dropdown

click on documents and then add data to be added in the core.Format of document can be specify by you.

OR

Type this command in solr-(versioname)\example\exampledocs

java -Dc=my_core -Dtype=text/csv -jar post.jar test.csv

where my_core is corename,
type is csv and
test.csv is file to be imported.

Upvotes: 4

Adil Abbasi
Adil Abbasi

Reputation: 3291

Need to mention collection name, for new versions you can write simply this command.

bin/post -c gettingstarted example/exampledocs/*.xml

Upvotes: 1

onetuser
onetuser

Reputation: 236

Executing a command line from tutorial below unix command line helped. I.e. on Windows and solr 5.4.1 my terminal line looked like

c:\solr-5.4.1> java -classpath dist/solr-core-5.4.1.jar -Dauto=yes 
    -Dc=gettingstarted -Ddata=files 
    -Drecursive=yes org.apache.solr.util.SimplePostTool docs/

Upvotes: 0

Dirk Schumacher
Dirk Schumacher

Reputation: 1655

When running the Solr Quick Start on Windows I faced the same problem. In the comments of the guide I found what worked for me:

C:\opt\solr-5.2.1>java -Dc=gettingstarted -jar example\exampledocs\post.jar example\exampledocs\*.xml

That got me the following output:

C:\opt\solr-5.2.1>java -Dc=gettingstarted -jar example\exampledocs\post.jar example\exampledocs\*.xml
SimplePostTool version 5.0.0
Posting files to [base] url http://localhost:8983/solr/gettingstarted/update using content-type application/xml...
POSTing file gb18030-example.xml to [base]
POSTing file hd.xml to [base]
POSTing file ipod_other.xml to [base]
POSTing file ipod_video.xml to [base]
POSTing file manufacturers.xml to [base]
POSTing file mem.xml to [base]
POSTing file money.xml to [base]
POSTing file monitor.xml to [base]
POSTing file monitor2.xml to [base]
POSTing file mp500.xml to [base]
POSTing file sd500.xml to [base]
POSTing file solr.xml to [base]
POSTing file utf8-example.xml to [base]
POSTing file vidcard.xml to [base]
14 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/gettingstarted/update...
Time spent: 0:00:22.043

The -Dc parameter does the trick.

On the other hand when only running with the folder docs it did not work. But this is not scope of my answer since I only wanted to show how to get it running anyhow.

Upvotes: 19

Alexandre Rafalovitch
Alexandre Rafalovitch

Reputation: 9789

With version 5, the default collection has effectively gone away. So, there is no way for the tool to know which URL to use to connect to your collection.

If you are using examples, then your server is most probably default at localhost:8983 and you only need to specify the collection by name. If you are doing something more tricky, you may need to specify the whole URL.

Upvotes: 2

Related Questions