Using solr on windows

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Using solr on windows

Kainth, Sachin
Hi all,

I'm new to solr.  I've just installed it and am trying to run the
example.  The problem is that the tutorial seems to suggest that you
need Unix to run solr.  For example to add a document to the
solr?/lucene? Index you need to do this:

chrish@asimov:~/tmp/solr/solr-nightly/example/exampledocs$ sh post.sh
solr.xml
Posting file solr.xml to http://localhost:8983/solr/update
<result status="0"></result>
<result status="0"></result>

As far as I know though there is no "sh" command on Windows.

Cheers

Sachin




This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really need to.
Reply | Threaded
Open this post in threaded view
|

Re: Using solr on windows

Erik Hatcher

On Feb 14, 2007, at 6:01 AM, Kainth, Sachin wrote:

> I'm new to solr.  I've just installed it and am trying to run the
> example.  The problem is that the tutorial seems to suggest that you
> need Unix to run solr.  For example to add a document to the
> solr?/lucene? Index you need to do this:
>
> chrish@asimov:~/tmp/solr/solr-nightly/example/exampledocs$ sh post.sh
> solr.xml
> Posting file solr.xml to http://localhost:8983/solr/update
> <result status="0"></result>
> <result status="0"></result>
>
> As far as I know though there is no "sh" command on Windows.

You don't need Unix to run Solr... Solr is a Java web application.

The example has a Unix shell script to post the example data, but you  
could run that on Windows using Cygwin.  We should add a note to the  
wiki to this effect.

Also, I'm pretty sure we'll have more clients that can post these  
files.  In fact, this would be a pretty trivial addition to solrb,  
the Ruby interface to Solr.

So give Cygwin a try and see if that works for you.

        Erik

Reply | Threaded
Open this post in threaded view
|

Re: Using solr on windows

Bertrand Delacretaz
In reply to this post by Kainth, Sachin
On 2/14/07, Kainth, Sachin <[hidden email]> wrote:

> ...The problem is that the tutorial seems to suggest that you
> need Unix to run solr...

Solr itself should run fine on Windows, but you're right that most or
all of the scripts provided with Solr require a unixish shell.

Installing cygwin should allow you to run those scripts directly, but
if it's just to run the post.sh script, you can use any tool (wget,
curl) that can do a POST, and those are available for windows (at
least wget, and recent version can POST). Just look at post.sh to see
how curl is called, using similar under Windows should work.

It'd be cool to have a Windows (or Java) version of post.sh, as IIUC
this is the only thing that prevents Windows users from trying Solr in
10 minutes. If someone wants to write that I'm sure we'd be happy to
integrate it in the codebase.

-Bertrand
Reply | Threaded
Open this post in threaded view
|

RE: Using solr on windows

Kainth, Sachin
Thanks for the replies,

I have now tried using cygwin and the result was this:

Posting file
C:\apache-solr-1.1.0-incubating\example\exampledocs\solr.xml to htt
p://localhost:8983/solr/update
/cygdrive/c/apache-solr-1.1.0-incubating/example/exampledocs/post.sh:
line 22: c
url: command not found

/cygdrive/c/apache-solr-1.1.0-incubating/example/exampledocs/post.sh:
line 27: c
url: command not found

Any ideas?

 

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Bertrand Delacretaz
Sent: 14 February 2007 11:29
To: [hidden email]
Subject: Re: Using solr on windows

On 2/14/07, Kainth, Sachin <[hidden email]> wrote:

> ...The problem is that the tutorial seems to suggest that you need
> Unix to run solr...

Solr itself should run fine on Windows, but you're right that most or
all of the scripts provided with Solr require a unixish shell.

Installing cygwin should allow you to run those scripts directly, but if
it's just to run the post.sh script, you can use any tool (wget,
curl) that can do a POST, and those are available for windows (at least
wget, and recent version can POST). Just look at post.sh to see how curl
is called, using similar under Windows should work.

It'd be cool to have a Windows (or Java) version of post.sh, as IIUC
this is the only thing that prevents Windows users from trying Solr in
10 minutes. If someone wants to write that I'm sure we'd be happy to
integrate it in the codebase.

-Bertrand


This message has been scanned for viruses by MailControl - (see
http://bluepages.wsatkins.co.uk/?4318150)


This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really need to.
Reply | Threaded
Open this post in threaded view
|

Re: Using solr on windows

Erik Hatcher

On Feb 14, 2007, at 6:34 AM, Kainth, Sachin wrote:

> Thanks for the replies,
>
> I have now tried using cygwin and the result was this:
>
> Posting file
> C:\apache-solr-1.1.0-incubating\example\exampledocs\solr.xml to htt
> p://localhost:8983/solr/update
> /cygdrive/c/apache-solr-1.1.0-incubating/example/exampledocs/post.sh:
> line 22: c
> url: command not found
>
> /cygdrive/c/apache-solr-1.1.0-incubating/example/exampledocs/post.sh:
> line 27: c
> url: command not found
>
> Any ideas?

Cygwin needs curl installed.  It should be fairly easy to select that  
and have it installed.  It's been a while since I've used cygwin, but  
I do recall a list of packages to install.

        Erik

Reply | Threaded
Open this post in threaded view
|

Re: Using solr on windows

Walter Lewis-2
Erik Hatcher wrote:
> Cygwin needs curl installed.  It should be fairly easy to select that
> and have it installed.  It's been a while since I've used cygwin, but
> I do recall a list of packages to install.
I would just note that, while the examples as designed around Cygwin, it
is by no means a dependency for running SOLR.

Curl is available as a binary for Win32, in its latest release, and runs
from an ordinary command window. The implication is that you can also
build batch files that mimic the functionality of the .sh files in the
examples.

The following would need to be adjusted for the host name and port, and
the name of the instance of solr, but they will run from the command
prompt in the directory where curl is installed.

curl http://localhost/solr/update --data-binary @test.xml
curl http://localhost/solr/update --data-binary "<commit />"
curl http://localhost/solr/update --data-binary "<optimize />"

Tomcat or apache/tomcat on Windows 2003 is a perfectly adequate servlet
container for solr.  For that matter, SirsiDynix's Horizon runs Jetty
over Windows 2003 in many of their production environments, it's just a
bear to configure as a service.

Walter Lewis
Reply | Threaded
Open this post in threaded view
|

AW: Using solr on windows

Burkamp, Christian
In reply to this post by Kainth, Sachin
Hi,

if you have a copy of curl installed this script should work as a windows replacement for post.sh. You could name it post.bat.
Don't forget to adjust the hostname and port if you don't have Solr running on the local machine.

--snip-----------
rem echo off
setlocal
set URL="http://localhost:8983/solr/update"
set params=%*%

FOR %%f IN (%params%) DO curl %URL% --data-binary @%%f -H "Content-type:text/xml; charset=utf-8"
curl %URL% --data-binary "<commit/>"
--snip-----------


Christian

-----Urspr√ľngliche Nachricht-----
Von: Kainth, Sachin [mailto:[hidden email]]
Gesendet: Mittwoch, 14. Februar 2007 12:02
An: [hidden email]
Betreff: Using solr on windows

Hi all,

I'm new to solr.  I've just installed it and am trying to run the
example.  The problem is that the tutorial seems to suggest that you
need Unix to run solr.  For example to add a document to the
solr?/lucene? Index you need to do this:

chrish@asimov:~/tmp/solr/solr-nightly/example/exampledocs$ sh post.sh
solr.xml
Posting file solr.xml to http://localhost:8983/solr/update
<result status="0"></result>
<result status="0"></result>

As far as I know though there is no "sh" command on Windows.

Cheers

Sachin




This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really need to.

Reply | Threaded
Open this post in threaded view
|

Re: Using solr on windows

Yonik Seeley-2
In reply to this post by Kainth, Sachin
On 2/14/07, Kainth, Sachin <[hidden email]> wrote:
> Hi all,
>
> I'm new to solr.  I've just installed it and am trying to run the
> example.  The problem is that the tutorial seems to suggest that you
> need Unix to run solr.

Did you skip over the "requirements" section in the tutorial?  ;-)

'''
On Win32, cygwin, for shell support. (If you plan to use Subversion on
Win32, be sure to select the subversion package when you install, in
the "Devel" category.) This tutorial will assume that "sh" is in your
PATH, and that you have "curl" installed from the "Web" category.
'''

An aside: I'm not sure if the explicit "sh" should be needed any more
when running commands since we figured out how to get the zip file to
hold +x attributes.

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: Using solr on windows

Chris Hostetter-3
In reply to this post by Bertrand Delacretaz

: It'd be cool to have a Windows (or Java) version of post.sh, as IIUC
: this is the only thing that prevents Windows users from trying Solr in
: 10 minutes. If someone wants to write that I'm sure we'd be happy to
: integrate it in the codebase.

I'll try to clean up and commit SOLR-86 sometime this weekend.


-Hoss