5
votes

I'm working on apache solr 5,when I'm trying to execute $ bin/post -c gettingstarted example/exampledocs/*.json, I am getting warning like

'bin' is not recognized as an internal or external command, operable program or batch file.

It's working when I execeute bin\solr create -c test.

Please help me out, I'm new to solr concepts.

Thanks

3
Refer this answer the problem seems to be same http://stackoverflow.com/a/36890331/2114781 - Shalu

3 Answers

10
votes

the issue is not with Solr, its with the command you are typing. Linux directories are traversed using '/' while windows with '\'. Assuming your OS is windows, from your current working directory (which is the solr folder in this example) bin\solr is a valid path, hence that executes. however bin/solr being an invalid path fails to execute. Hence your first command should work from the same location in Unix/Linux systems, second one in Windows

EDIT: I just downloaded the solr installer as zip from the solr site. The post file is indeed a shell script, which is why you are unable to execute it on windows. (my understanding was that .gzips were linux installers and .zip for windows always, which is clearly not the case here.)

What you probably can do is check this answer and follow the approach mentioned there. Hopefully that will get you up and running.

Hope it helps!

2
votes

Although it is too late to answer this question, but it might be helpful to others who face this issue.

bin/post exists only as Unix shell script. Internally it uses a Java program SimplePostTool, which is present in the jar : example\exampledocs\post.jar. To use post in Windows, run the command java -jar example/exampledocs/post.jar instead of bin\post. For example, post -h can be run as : java -jar example/exampledocs/post.jar -h.

-1
votes

You are trying to copy all the file with extension .json to your core named "gettingstarted" using post tool. But post tool does not supported for windows. Please visit following link. Hope this will help.

https://cwiki.apache.org/confluence/display/solr/Post+Tool#PostTool-Windows