Forum: Ruby on Rails Ruby + Apache Lucene using XMLRPC?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
softwareengineer 99 (Guest)
on 2006-02-20 04:47
(Received via mailing list)
Please excuse me if this has been answered before.

    Is there a "how-to" guide or a walkthrough on integrating Lucene
with ROR  via XMLRPC?

    I got Ferret to work but I am worried that it's not going to be as
scalable.

    I highly appreciate your assistance.

    Thanks
    Frank
Erik H. (Guest)
on 2006-02-20 20:49
(Received via mailing list)
On Feb 19, 2006, at 9:44 PM, softwareengineer 99 wrote:

> Please excuse me if this has been answered before.
>
> Is there a "how-to" guide or a walkthrough on integrating Lucene
> with ROR  via XMLRPC?
>
> I got Ferret to work but I am worried that it's not going to be as
> scalable.
>
> I highly appreciate your assistance.

A week or so ago I posted the details of my custom XML-RPC server
(check the archives for it).  There isn't one built into Lucene,
though there are certainly a number of projects that do wrap Lucene
behind web services of one sort or another including the now
incubating Solr project.

Ferret may be suitable - only testing (or real world use!) will tell.

	Erik
Nick S. (Guest)
on 2006-02-20 21:58
(Received via mailing list)
Check out my little write up here:
http://blog.nicholasstuart.com/articles/2006/02/11...

If you have any more specific questions I would be happy to help out.

-Nick
softwareengineer 99 (Guest)
on 2006-02-20 23:23
(Received via mailing list)
Hey Nick,
  Thanks for your reply.

  Though I have studied Java quite a bit, it's been terribly long time
since I programmed in that language (back in the university days).

  I have a few questions:
  What version of Apache are you using?
  How long did it take you to implement Lucene
  Do I need to install TomCat to have it running?
  Why are you using Apache's XML-RPC server? Isn't there XML-RPC
functionality with Rails? Just curious.

  I will eventually buy Erik H.'s book but want to weigh my options
and get my test project working with Lucene.


  Thanks for your help

  Frank

Nick S. <removed_email_address@domain.invalid> wrote:  Check out my little
write up here:
http://blog.nicholasstuart.com/articles/2006/02/11...

If you have any more specific questions I would be happy to help out.

-Nick
softwareengineer 99 (Guest)
on 2006-02-20 23:29
(Received via mailing list)
Thanks Erik for your reply.

  Do I need Tomcat running for this to work?  Do I have any option of
not using Tomcat?
  Where do I put the XML-RPC server code?
  Must I install the Apache XML-RPC server? Is the installation
reversible?

  Thanks
  Frank

Erik H. <removed_email_address@domain.invalid> wrote:
On Feb 19, 2006, at 9:44 PM, softwareengineer 99 wrote:

> Please excuse me if this has been answered before.
>
> Is there a "how-to" guide or a walkthrough on integrating Lucene
> with ROR  via XMLRPC?
>
> I got Ferret to work but I am worried that it's not going to be as
> scalable.
>
> I highly appreciate your assistance.

A week or so ago I posted the details of my custom XML-RPC server
(check the archives for it).  There isn't one built into Lucene,
though there are certainly a number of projects that do wrap Lucene
behind web services of one sort or another including the now
incubating Solr project.

Ferret may be suitable - only testing (or real world use!) will tell.

 Erik

_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
Tony C. (Guest)
on 2006-02-20 23:36
(Received via mailing list)
On 2/20/06, softwareengineer 99 <removed_email_address@domain.invalid> wrote:
>
> Thanks Erik for your reply.
>
> Do I need Tomcat running for this to work?  Do I have any option of not
> using Tomcat?


You don't need Tomcat. Just a JDK to compile and run.  As you can see,
the
code creates its own webserver on port 8080.

Where do I put the XML-RPC server code?


Anywhere you want your Java code to live.

Must I install the Apache XML-RPC server? Is the installation
reversible?


At most you probably need the Apache XMLRPC Jar file(s), and probably
the
Lucene Jars to run the server code.  It's just Java, it won't bite :)

Tony
Nick S. (Guest)
on 2006-02-20 23:39
(Received via mailing list)
On 2/20/06, softwareengineer 99 <removed_email_address@domain.invalid> wrote:
> Hey Nick,
>  Thanks for your reply.
>
>  Though I have studied Java quite a bit, it's been terribly long time since
> I programmed in that language (back in the university days).
>
>  I have a few questions:
>  What version of Apache are you using?
For the Web Server I'm running Apache 2.5.x (can't remember specific)

>  How long did it take you to implement Lucene
Not long at all, maybe a day or two. But, I've also been actively
programming in Java for awhile, and still am, so that helps me out a
bit.

>  Do I need to install TomCat to have it running?
No, I wanted to avoid just this situation. I didn't want a whole
servlet container just for searching.

>  Why are you using Apache's XML-RPC server? Isn't there XML-RPC
> functionality with Rails? Just curious.
I'm actually using both. The reason for Apache's XML-RPC server is so
that I can directly interact with Lucene through Java and not have to
worry about any cross language issues.

And actually, Rails itself doesn't have any XML-RPC, but Ruby comes
bundled with both a client and a server, of which only the client is
needed in this case. Incredibly handy, I must say.

Hope this helps!
-Nick
Nick S. (Guest)
on 2006-02-20 23:43
(Received via mailing list)
If you go with a straight Java solution for this all your server code
is going just your main program, and thats it (see my blog, what you
see there is all the server code I wrote).

And you need to really 'install' the server. Its just a simple JAR
file that your include/reference in your own program.
softwareengineer 99 (Guest)
on 2006-02-20 23:43
(Received via mailing list)
Thanks Tony for your reply.

  So should I install JDK with Netbeans from the following location?
  http://java.sun.com/j2se/1.5.0/download-netbeans-50.html

  Any tips or gotcha's I need to be aware of?

  Must the installation be done in a directory accessible over the
Internet if I want Lucene to work?

  Thanks
  Frank


Tony C. <removed_email_address@domain.invalid> wrote:  You don't need Tomcat. 
Just a
JDK to compile and run.   As you can see, the code creates its own
webserver on port 8080.

  Where do I put the XML-RPC server code?
Anywhere you want your Java code to live.


  Must I install the Apache XML-RPC server? Is the installation
reversible?
At most you probably need the Apache XMLRPC Jar file(s), and  probably
the Lucene Jars to run the server code.  It's just Java,  it won't bite
:)

Tony



  _______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
softwareengineer 99 (Guest)
on 2006-02-20 23:46
(Received via mailing list)
Thank you Nick.
  It seems like I will get started on this tonight and will ask if I
have any questions.

  Thank you very much


Nick S. <removed_email_address@domain.invalid> wrote:Not long at all, maybe a
day or two. But, I've also been actively
programming in Java for awhile, and still am, so that helps me out a
bit.



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
Tony C. (Guest)
on 2006-02-20 23:55
(Received via mailing list)
On 2/20/06, softwareengineer 99 <removed_email_address@domain.invalid> wrote:
>
> Thanks Tony for your reply.
>
> So should I install JDK with Netbeans from the following location?
> http://java.sun.com/j2se/1.5.0/download-netbeans-50.html


Sure, that seems reasonable.

Any tips or gotcha's I need to be aware of?
>
> Must the installation be done in a directory accessible over the Internet
> if I want Lucene to work?



I'm not sure about the internals of Lucene -- you'll probably want to
check
the docs.

Tony
softwareengineer 99 (Guest)
on 2006-02-20 23:58
(Received via mailing list)
Sorry for asking a basic question but which JDK should I install? With
or without netbeans?

  Thanks
  Frank



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
softwareengineer 99 (Guest)
on 2006-02-21 00:02
(Received via mailing list)
Thank you very much.

  Frank

Tony C. <removed_email_address@domain.invalid> wrote:  On 2/20/06, 
softwareengineer 99
<removed_email_address@domain.invalid> wrote:  Thanks Tony for your reply.

  So should I install JDK with Netbeans from the following location?
    http://java.sun.com/j2se/1.5.0/download-netbeans-50.html
Sure, that seems reasonable.


    Any tips or gotcha's I need to be aware of?

  Must the installation be done in a directory accessible over the
Internet if I want Lucene to work?

I'm not sure about the internals of Lucene -- you'll probably want to
check the docs.

Tony

  _______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
softwareengineer 99 (Guest)
on 2006-02-21 00:33
(Received via mailing list)
I keep getting the following errors (I have tried re-downloading three
times)
  ------------------
          Initializing InstallShield Wizard........
            Extracting Bundled JRE.

        Bundled JRE is not binary compatible  with host OS/Arch or it is
corrupt.  Testing bundled JRE failed.
  ------------------


I downloaded the version for Linux (jdk-1_5_0_06-nb-5_0-linux.bin)

  I am using RHEL 3
  Any ideas?

  Thanks
  Frank
Tony C. <removed_email_address@domain.invalid> wrote:  On 2/20/06, 
softwareengineer 99
<removed_email_address@domain.invalid> wrote:  Thanks Tony for your reply.

  So should I install JDK with Netbeans from the following location?
    http://java.sun.com/j2se/1.5.0/download-netbeans-50.html
Sure, that seems reasonable.


    Any tips or gotcha's I need to be aware of?

  Must the installation be done in a directory accessible over the
Internet if I want Lucene to work?

I'm not sure about the internals of Lucene -- you'll probably want to
check the docs.

Tony

  _______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
Ben M. (Guest)
on 2006-02-21 05:09
(Received via mailing list)
You don't need netbeans... that's an IDE... like Eclipse. Should make
your download *much*
smaller. Just the latest version of the JDK should do ya.

Sun's site can be extremely confusing, so go here:

http://java.sun.com/j2se/1.5.0/download.jsp

and click on the "Download JDK 5.0 Update 6" link below the netbeans and
j2ee sections.

Then, click on the "accept" radio button and then click on one of the
linux downloads.
Being on Red Hat, the RPM would probably do ya just fine.

b
Zed S. (Guest)
on 2006-02-21 10:07
(Received via mailing list)
Just use Hyper Estraier.  http://hyperestraier.sourceforge.net/

* Much easier to setup and access via a simple REST API from Ruby, Java,
or
C.
* Easily clusterable with the ability segregate nodes or join them for
combined results.
* Fast as hell.  We use it at the NYC Dept. of Correction to find stuff
and
not only does it blow Lucene out of the water even though it's a server,
it's easier to setup--even on windows.
* Gives good results with attributes, vectors, and other goodies
included.
* Has a REST interface but you can just use the pure Ruby, Java, or C
API to
access it.
  - I'm mentioning this again because it's the best feature.
* Runs on Windows right out of the box.
* Takes 10 minutes to setup, less on windows.  That's right, less.  No
JVM.
All fast binary goodness baby.
* You can embed it as a library via Ruby or Java if you want the
absolute
fastest.
  - Yes, this means that HE out of the box does local/embedded, remote
distributed, and linkable P2P clustered search infrastructure with
minimal
setup for three languages.
* Has a decent web UI for managing an estraier master (that's the server
that controls the thing).
* Don't need to buy an O'Reilly book to figure it out.  Plenty of code
examples and decent docs considering the author is Japanese (better than
most English speaker's docs really).
* Supports phrase search, regular expressions, attribute search, and
similarity search with Unicode support.

Only thing I've ran into is that OSX people will find that darwin port's
version is super old (man those guys need a kick in the ass).  I'm
currently
trying to build it on OSX and should have some instructions for it soon.

Otherwise HE is the freaking bomb for Ruby projects simply because it's
so
damn easy to access from any language via the rest interface.  And when
I
say access I don't mean just doing searches but also administering the
master servers.

I figure if it's good enough for half of rails-core and nearly every
other
Rails shop I've shown it to then it's good enough for you folks to at
least
try.

Zed A. Shaw
http://www.zedshaw.com/
Zed S. (Guest)
on 2006-02-21 10:19
(Received via mailing list)
Almost forgot my favorite hidden feature:

* You can get Atom or RSS feeds for search results from the master UI.

Now that's slick.

Zed A. Shaw
http://www.zedshaw.com/
Ugo C. (Guest)
on 2006-02-21 14:41
(Received via mailing list)
Il giorno 20/feb/06, alle ore 23:30, softwareengineer 99 ha scritto:

> I keep getting the following errors (I have tried re-downloading
> three times)
> ------------------
>         Initializing InstallShield Wizard........
>           Extracting Bundled JRE.
>
>       Bundled JRE is not binary compatible with host OS/Arch or it
> is corrupt.  Testing bundled JRE failed.

Download the one without NetBeans (NetBeans is just an IDE. Do you
need an IDE for what you're trying to do? If you do, you can always
download it later). It comes as a self-extracting executable that you
run anywhere you like, than you simply set the JAVA_HOME environment
to the directory where you unpacked it into and add $JAVA_HOME/bin to
your PATH. If you then type "java -version" it should tell you what
version you have installed.

	Ugo


--
Ugo C.
Blog: http://agylen.com/
Open Source Zone: http://oszone.org/
Evil or Not?: http://evilornot.info/
Company: http://www.sourcesense.com/
Scott B. (Guest)
on 2006-02-21 16:41
(Received via mailing list)
On Feb 21, 2006, at 3:07 AM, Zed S. wrote:

>
> Only thing I've ran into is that OSX people will find that darwin
> port's
> version is super old (man those guys need a kick in the ass).  I'm
> currently
> trying to build it on OSX and should have some instructions for it
> soon.

It should build cleanly on OSX, just remember to use 'make mac' (or
something like that) instead of regular 'make all'.  I think that
applies to the QDBM
package, too.

> Rails shop I've shown it to then it's good enough for you folks to
> at least
> try.

Definitely.  Use it and love it.


-Scott
softwareengineer 99 (Guest)
on 2006-02-21 20:25
(Received via mailing list)
Hi Ugo,

  Thanks for your reply.
  I have been trying to find the download location to download JDK
without Netbeans but so far I am unsuccessful.

  I will keep searching for it.
  I will appreciate if oyu can provide any pointers.


  Thanks
  Frank

Ugo C. <removed_email_address@domain.invalid> wrote:
Download the one without NetBeans (NetBeans is just an IDE. Do you
need an IDE for what you're trying to do? If you do, you can always
download it later). It comes as a self-extracting executable that you
run anywhere you like, than you simply set the JAVA_HOME environment
to the directory where you unpacked it into and add $JAVA_HOME/bin to
your PATH. If you then type "java -version" it should tell you what
version you have installed.

 Ugo


--
Ugo C.
Blog: http://agylen.com/
Open Source Zone: http://oszone.org/
Evil or Not?: http://evilornot.info/
Company: http://www.sourcesense.com/


_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
Nick S. (Guest)
on 2006-02-21 20:52
(Received via mailing list)
Not sure how much easier it is then the 3 lines of ruby code and 5 or
so of Java to get the two talking.
>
> * Much easier to setup and access via a simple REST API from Ruby, Java, or
> C.
> * Easily clusterable with the ability segregate nodes or join them for
> combined results.

Lucene is also known for being speedy, and everything I've seen tends
to agree with this.
> * Fast as hell.  We use it at the NYC Dept. of Correction to find stuff and
> not only does it blow Lucene out of the water even though it's a server,
> it's easier to setup--even on windows.

Lucene will do the same giving you full document results back with
waited scroes and the like (I'm probably miss stating something here,
as my 'advanced' knowledge of Lucene is lacking)
> * Gives good results with attributes, vectors, and other goodies included.

+1 For HE on this one
> * Has a REST interface but you can just use the pure Ruby, Java, or C API to
> access it.
>   - I'm mentioning this again because it's the best feature.

So does Lucene/Java (obviously need the JRE installed, 5 mins at best
there)
> * Runs on Windows right out of the box.
> * Takes 10 minutes to setup, less on windows.  That's right, less.  No JVM.
> All fast binary goodness baby.

Following few points seem a bit overfill when all you need is a search
tool. (clustering might be useful for insanly large search (NYC
anything in your case would fit))
> * You can embed it as a library via Ruby or Java if you want the absolute
> fastest.
>   - Yes, this means that HE out of the box does local/embedded, remote
> distributed, and linkable P2P clustered search infrastructure with minimal
> setup for three languages.
> * Has a decent web UI for managing an estraier master (that's the server
> that controls the thing).

Didn't buy any myself for Lucene, online examples and included
examples with source code were enough for me.
> * Don't need to buy an O'Reilly book to figure it out.  Plenty of code
> examples and decent docs considering the author is Japanese (better than
> most English speaker's docs really).

Lucene does the same (not sure on regular expressions, but would be
surprised if it didnt)
> * Supports phrase search, regular expressions, attribute search, and
> similarity search with Unicode support.
>

I'm not bashing HE in anyway as I've never used it, but just trying to
point your (or anyones) "Just use X.." statment is misleading and can
lead to narrow minded descions. While HE may work for you and others,
that doesn't mean that something else wont fill the role just as
nicely and maybe even better. So why not state, "Why not give X a
try.,," and then follow on with the reasons why YOU like it.

Sorry for the rambling, but thats my 2cents...

-Nick
softwareengineer 99 (Guest)
on 2006-02-22 03:46
(Received via mailing list)
Thank you Ben very much.

  Sun's site is definitely confusing.

  I will give it a try tonight.

  Thanks
  Frank

Ben M. <removed_email_address@domain.invalid> wrote:  Sun's site can be 
extremely
confusing, so go here:

http://java.sun.com/j2se/1.5.0/download.jsp

and click on the "Download JDK 5.0 Update 6" link below the netbeans and
j2ee sections.

Then, click on the "accept" radio button and then click on one of the
linux downloads.
Being on Red Hat, the RPM would probably do ya just fine.

b



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
softwareengineer 99 (Guest)
on 2006-02-22 04:39
(Received via mailing list)
Hello Nick,

  I tried to run a test server using the code on your blog
(http://blog.nicholasstuart.com/articles/2006/02/11...)
but I am unsure as to what goes in the ... parts.

  For now I keep getting the errors:



  Main.java:3: cannot find symbol
  symbol  : class WebServer
  location: class Main
      static WebServer server;
             ^
  Main.java:21: cannot find symbol
  symbol  : class Vector
  location: class Main
      public Vector searchAssets(String term){
             ^
  Main.java:24: cannot find symbol
  symbol  : class Vector
  location: class Main
      public Vector searchPages(String term){
             ^
  Main.java:7: cannot find symbol
  symbol  : class WebServer
  location: class Main
          server = new WebServer(port);
                       ^


  I appreciate your assistance very much.

  Thanks
  Frank

Ben M. <removed_email_address@domain.invalid> wrote:  You don't need netbeans... 
that's an
IDE... like Eclipse. Should make your download *much*
smaller. Just the latest version of the JDK should do ya.

Sun's site can be extremely confusing, so go here:

http://java.sun.com/j2se/1.5.0/download.jsp

and click on the "Download JDK 5.0 Update 6" link below the netbeans and
j2ee sections.

Then, click on the "accept" radio button and then click on one of the
linux downloads.
Being on Red Hat, the RPM would probably do ya just fine.

b


softwareengineer 99 wrote:
> Linux / Security Blog: http://frankmash.blogspot.com
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
softwareengineer 99 (Guest)
on 2006-02-22 04:39
(Received via mailing list)
Zed,

  I appreciate you taking the time to reply.

  I would love to try HE out but worry that it may not fulfill my
requirements. I have over 5 GB of data that needs to be indexed and
that's just the start. As time goes my data needs will grow. May be for
other projects.

  Just curious how big is your database?

  Thanks for your help.

  Frank

Zed S. <removed_email_address@domain.invalid> wrote:  Just use Hyper Estraier.
http://hyperestraier.sourceforge.net/

* Much easier to setup and access via a simple REST API from Ruby, Java,
or
C.
* Easily clusterable with the ability segregate nodes or join them for
combined results.
* Fast as hell.  We use it at the NYC Dept. of Correction to find stuff
and
not only does it blow Lucene out of the water even though it's a server,
it's easier to setup--even on windows.
* Gives good results with attributes, vectors, and other goodies
included.
* Has a REST interface but you can just use the pure Ruby, Java, or C
API to
access it.
  - I'm mentioning this again because it's the best feature.
* Runs on Windows right out of the box.
* Takes 10 minutes to setup, less on windows.  That's right, less.  No
JVM.
All fast binary goodness baby.
* You can embed it as a library via Ruby or Java if you want the
absolute
fastest.
  - Yes, this means that HE out of the box does local/embedded, remote
distributed, and linkable P2P clustered search infrastructure with
minimal
setup for three languages.
* Has a decent web UI for managing an estraier master (that's the server
that controls the thing).
* Don't need to buy an O'Reilly book to figure it out.  Plenty of code
examples and decent docs considering the author is Japanese (better than
most English speaker's docs really).
* Supports phrase search, regular expressions, attribute search, and
similarity search with Unicode support.

Only thing I've ran into is that OSX people will find that darwin port's
version is super old (man those guys need a kick in the ass).  I'm
currently
trying to build it on OSX and should have some instructions for it soon.

Otherwise HE is the freaking bomb for Ruby projects simply because it's
so
damn easy to access from any language via the rest interface.  And when
I
say access I don't mean just doing searches but also administering the
master servers.

I figure if it's good enough for half of rails-core and nearly every
other
Rails shop I've shown it to then it's good enough for you folks to at
least
try.

Zed A. Shaw
http://www.zedshaw.com/


On 2/20/06 4:39 PM, "Nick S."  wrote:

>
>> functionality with Rails? Just curious.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails

_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
softwareengineer 99 (Guest)
on 2006-02-22 05:35
(Received via mailing list)
I keep getting the following errors:

  symbol  : class IndexReader
  location: class SearchServer
     private IndexReader reader;
             ^
  Main.java:3: cannot find symbol
  symbol  : class IndexSearcher
  location: class SearchServer
     private IndexSearcher searcher;
             ^
  Main.java:5: cannot find symbol
  symbol  : class Directory
  location: class SearchServer
     public SearchServer(Directory directory) throws IOException {
                          ^


  Any ideas?

  Thanks
  Frank

Erik H. <removed_email_address@domain.invalid> wrote:
On Feb 19, 2006, at 9:44 PM, softwareengineer 99 wrote:

> Please excuse me if this has been answered before.
>
> Is there a "how-to" guide or a walkthrough on integrating Lucene
> with ROR  via XMLRPC?
>
> I got Ferret to work but I am worried that it's not going to be as
> scalable.
>
> I highly appreciate your assistance.

A week or so ago I posted the details of my custom XML-RPC server
(check the archives for it).  There isn't one built into Lucene,
though there are certainly a number of projects that do wrap Lucene
behind web services of one sort or another including the now
incubating Solr project.

Ferret may be suitable - only testing (or real world use!) will tell.

 Erik

_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
softwareengineer 99 (Guest)
on 2006-02-22 05:44
(Received via mailing list)
I would like to give it a try too.

  Is there an RPM available?

  Do I need to install http://hyperestraier.sourceforge.net/ and
http://hyperestraier.sourceforge.net/rubynativeapi/ ?

  Any potential (harmful issues with installing QDBM and ZLib on my
Linux server?

  Thanks
  Frank

Scott B. <removed_email_address@domain.invalid> wrote:
On Feb 21, 2006, at 3:07 AM, Zed S. wrote:

>
> Only thing I've ran into is that OSX people will find that darwin
> port's
> version is super old (man those guys need a kick in the ass).  I'm
> currently
> trying to build it on OSX and should have some instructions for it
> soon.

It should build cleanly on OSX, just remember to use 'make mac' (or
something like that) instead of regular 'make all'.  I think that
applies to the QDBM
package, too.

> Rails shop I've shown it to then it's good enough for you folks to
> at least
> try.

Definitely.  Use it and love it.


-Scott
_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
softwareengineer 99 (Guest)
on 2006-02-22 06:11
(Received via mailing list)
I have the JDK installed and working :)
  I also have the XML-RPC installed.

  Not sure how to integrate XML-RPC with Lucene and my application. I
earlier posted the errors I am getting about  my server not  finding the
symbols:

  "symbol  : class IndexReader
  location: class SearchServer
     private IndexReader reader;
  "

  How do I make Lucene available over a port or start it as a server so
it can be queried by my application?

  Can anyone please guide me.

  Thanks
  Frank



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
Ben M. (Guest)
on 2006-02-22 09:55
(Received via mailing list)
Well you're at least missing the import statements... that's why you get
"unresolved
symbol" errors.

I can tell you that Vector is java.util.Vector and I think Nick is
probably talking about
the XML-RPC WebServer class.. I think that's
org.apache.xmlrpc.webserver.WebServer.

So, you'd put:

import java.util.Vector
import org.apache.xmlrpc.webserver.WebServer

at the top of your file (above the "public class ... " line but below
any package
declaration if you have one).

Now all this is probably useless information cuz you don't know what
goes in the rest of
the "..."'s, but maybe Nick will be along soon. I don't think you need
anything after the
main method opening line and I would think that what goes in all the
indexing and search
methods would be specific to your case.

b
Erik H. (Guest)
on 2006-02-22 17:59
(Received via mailing list)
My apologies for not being more responsive on this thread.  The Rails
list is so active that I filter it to a folder and only go through
the messages when I get a rare few free minutes.

While it is "just Java" and it won't bite, there certainly is some
basic learning curve jumps to make.  I'm not sure what you mean by
"XML-RPC is installed".  To get this to work you will need a JDK and
two JAR files (the XML-RPC one and the Lucene one), both of which
will need to be in your classpath (much like the Ruby load path).

Lucene itself does not contain a "server", but the code posted uses
the Apache XML-RPC library to provide a server.  To compile the
server, as long as it is a single .java file, you can do something
like (this is psuedo-code, adapt it to your environment):

	javac -cp lucene-1.4.3.jar:xmlrpc-2.0.jar SearchServer.java

There may be other libraries needed?  I've got some other libraries
in my classpath for other reasons, not sure what dependencies
xmlrpc-2.0.jar has.  Lucene has no dependencies.

And then you'll have SearchServer.class which you can run like this:

	java -cp lucene-1.4.3.jar:xmlrpc-2.0.jar:. SearchServer

Again, the command-lines provided are off the cuff and may need some
tweaking for your environment or package names of the SearchServer
itself.

Best wishes,
	Erik
softwareengineer 99 (Guest)
on 2006-02-23 00:11
(Received via mailing list)
Dear Erik,

  Many thanks for your reply. I can imagine how "rare" a "few free
minutes" can be and certainly appreciate your assistance.

I placed the .jar files for Lucene and XML-RPC in my classpath and tried
to compile the SearchServer.java with:

  javac -cp
/var/java/jdk1.5.0_06/lib/lucene-1.4.3.jar:/var/java/jdk1.5.0_06/lib/xmlrpc-3.0a1.jar:/var/java/jdk1.5.0_06/lib/lucene-core-1.9-rc1.jar
/var/java/development/SearchServer.java

  I keep getting the following error:
  -----------------
  /var/java/development/SearchServer.java:55: cannot find symbol
  symbol  : method addHandler(java.lang.String,SearchServer)
  location: class org.apache.xmlrpc.webserver.WebServer
         server.addHandler("$default", new SearchServer
               ^
  1 error
  -----------------

  So far my searchServer.java (based on your code) includes:

  --------------------------------------
  import java.util.Vector;
  import org.apache.xmlrpc.webserver.WebServer;
  import  org.apache.lucene.index.IndexReader;
  import org.apache.lucene.search.IndexSearcher;
  import org.apache.lucene.store.FSDirectory;
  import org.apache.lucene.store.Directory;
  import java.io.BufferedReader;
  import java.io.InputStreamReader;
  import java.io.FileReader;
  import java.io.IOException;
  import org.apache.lucene.analysis.Analyzer;
  import org.apache.lucene.analysis.standard.StandardAnalyzer;
  import org.apache.lucene.analysis.standard.ParseException;
  import org.apache.lucene.document.Document;
  import org.apache.lucene.index.IndexReader;
  import org.apache.lucene.index.FilterIndexReader;
  import org.apache.lucene.search.Searcher;
  import org.apache.lucene.search.Query;
  import org.apache.lucene.search.Hits;
  import org.apache.lucene.queryParser.QueryParser;
  import java.util.Hashtable;

  public class SearchServer {
     private IndexReader reader;
     private IndexSearcher searcher;

     public SearchServer(Directory directory) throws IOException {
       reader = IndexReader.open(directory);
       searcher = new IndexSearcher(reader);
     }


     public Hashtable search(Vector constraints, int start, int max)
  throws IOException, ParseException {
       // ...
     }

     public static void main(String [] args) {
       String indexPath = args[0];
       int port = 8076;
       if (args.length > 1) {
         port = Integer.valueOf(args[1]).intValue();
       }

       try {
         WebServer server = new WebServer(port);
         server.addHandler("$default", new SearchServer
  (FSDirectory.getDirectory(indexPath, false)));
         server.start();
       } catch (Exception e) {
         System.err.println("SearchServer: " + e.toString());
         e.printStackTrace(System.err);
       }
     }
  }
  -------------------------------------------------

  Why is it complaining about server.addHandler method? What can I do
about it?


  I wish there was a step by step guide to integrating Rails with
Lucene.


  Thank you very much for your and Ben's assistance.



  Thanks
  Frank

Erik H. <removed_email_address@domain.invalid> wrote:  My apologies for not
being more responsive on this thread.  The Rails
list is so active that I filter it to a folder and only go through
the messages when I get a rare few free minutes.

While it is "just Java" and it won't bite, there certainly is some
basic learning curve jumps to make.  I'm not sure what you mean by
"XML-RPC is installed".  To get this to work you will need a JDK and
two JAR files (the XML-RPC one and the Lucene one), both of which
will need to be in your classpath (much like the Ruby load path).

Lucene itself does not contain a "server", but the code posted uses
the Apache XML-RPC library to provide a server.  To compile the
server, as long as it is a single .java file, you can do something
like (this is psuedo-code, adapt it to your environment):

 javac -cp lucene-1.4.3.jar:xmlrpc-2.0.jar SearchServer.java

There may be other libraries needed?  I've got some other libraries
in my classpath for other reasons, not sure what dependencies
xmlrpc-2.0.jar has.  Lucene has no dependencies.

And then you'll have SearchServer.class which you can run like this:

 java -cp lucene-1.4.3.jar:xmlrpc-2.0.jar:. SearchServer

Again, the command-lines provided are off the cuff and may need some
tweaking for your environment or package names of the SearchServer
itself.

Best wishes,
 Erik


On Feb 21, 2006, at 11:10 PM, softwareengineer 99 wrote:

> "
>
> Rails Blog: http://railsruby.blogspot.com
> MySQL Blog: http://mysqldatabaseadministration.blogspot.com
> Linux / Security Blog: http://frankmash.blogspot.com
>
> Yahoo! Mail
> Use Photomail to share photos without annoying attachments.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails

_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
softwareengineer 99 (Guest)
on 2006-02-23 00:14
(Received via mailing list)
Ben thank you for your email. It certainly did help. I am now getting
just one error for the server to compile (before putting in my search
methods). I posted the error details in an earlier message.

  Thanks again for your continued assistance.
  Frank

Ben M. <removed_email_address@domain.invalid> wrote:  Well you're at least 
missing the
import statements... that's why you get "unresolved
symbol" errors.


Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
Erik H. (Guest)
on 2006-02-23 16:13
(Received via mailing list)
On Feb 22, 2006, at 5:09 PM, softwareengineer 99 wrote:
> Many thanks for your reply. I can imagine how "rare" a "few free
> minutes" can be and certainly appreciate your assistance.
>
> I placed the .jar files for Lucene and XML-RPC in my classpath and
> tried to compile the SearchServer.java with:
>
> javac -cp /var/java/jdk1.5.0_06/lib/lucene-1.4.3.jar:/var/java/
> jdk1.5.0_06/lib/xmlrpc-3.0a1.jar:/var/java/jdk1.5.0_06/lib/lucene-
> core-1.9-rc1.jar /var/java/development/SearchServer.java

You have two different versions of Lucene in your classpath.  Remove
one of them (I recommend you use 1.9RC1 instead of 1.4.3).   This
shouldn't be related to the compilation error you're getting...

> I keep getting the following error:
> -----------------
> /var/java/development/SearchServer.java:55: cannot find symbol
> symbol  : method addHandler(java.lang.String,SearchServer)
> location: class org.apache.xmlrpc.webserver.WebServer
>        server.addHandler("$default", new SearchServer
>              ^
> 1 error

I just compiled my SearchServer using this command-line (normally I
use an Ant build file though):

$ javac -cp lib/lucene-core-1.9-rc1-dev.jar:lib/xmlrpc-2.0.jar src/
java/org/nines/SearchServer.java

And it compiled just fine.

	Erik
Ugo C. (Guest)
on 2006-02-23 19:09
(Received via mailing list)
Il giorno 21/feb/06, alle ore 19:22, softwareengineer 99 ha scritto:

> Hi Ugo,
>
> Thanks for your reply.
> I have been trying to find the download location to download JDK
> without Netbeans but so far I am unsuccessful.

Go to http://java.sun.com/j2se/1.5.0/download.jsp and click on
"Download JDK 5.0 Update 6".

	Ugo


--
Ugo C.
Blog: http://agylen.com/
Open Source Zone: http://oszone.org/
Evil or Not?: http://evilornot.info/
Company: http://www.sourcesense.com/
softwareengineer 99 (Guest)
on 2006-02-23 21:41
(Received via mailing list)
Erik,
  Thanks for your email.

  I removed the duplicate jar file and downloaded xmlrpc-2.0.jar
(instead  of v 3) and it compiled without any errors. I guess there is
some issue  with XMLRPC-3? Thank you very much for the tip.

  Now I have it compiled, I would like to customize the server and start
it so I can query it.

  Do I just put the lucene indexing methods in the searchServer.java?
  Is there an example code for indexing databases? Any reference
/pointers are highly appreciated.

  How do I start the server? I tried java SearchServer.java but it
complains about:

  Exception in thread "main" java.lang.NoClassDefFoundError

  Thank you so much once again. I obviously owe you ;)

  Thanks
  Frank

Erik H. <removed_email_address@domain.invalid> wrote:
On Feb 22, 2006, at 5:09 PM, softwareengineer 99 wrote:
> Many thanks for your reply. I can imagine how "rare" a "few free
> minutes" can be and certainly appreciate your assistance.
>
> I placed the .jar files for Lucene and XML-RPC in my classpath and
> tried to compile the SearchServer.java with:
>
> javac -cp /var/java/jdk1.5.0_06/lib/lucene-1.4.3.jar:/var/java/
> jdk1.5.0_06/lib/xmlrpc-3.0a1.jar:/var/java/jdk1.5.0_06/lib/lucene-
> core-1.9-rc1.jar /var/java/development/SearchServer.java

You have two different versions of Lucene in your classpath.  Remove
one of them (I recommend you use 1.9RC1 instead of 1.4.3).   This
shouldn't be related to the compilation error you're getting...

> I keep getting the following error:
> -----------------
> /var/java/development/SearchServer.java:55: cannot find symbol
> symbol  : method addHandler(java.lang.String,SearchServer)
> location: class org.apache.xmlrpc.webserver.WebServer
>        server.addHandler("$default", new SearchServer
>              ^
> 1 error

I just compiled my SearchServer using this command-line (normally I
use an Ant build file though):

$ javac -cp lib/lucene-core-1.9-rc1-dev.jar:lib/xmlrpc-2.0.jar src/
java/org/nines/SearchServer.java

And it compiled just fine.

 Erik

_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
softwareengineer 99 (Guest)
on 2006-02-23 22:42
(Received via mailing list)
Hello Erik and Lucene Gurus,

  I was able to get the Search Server compiled and was able to fix the
previous errors by moving SearchServer.java to my lib folder (It wasn't
working when I was adding current path to classpath in my .bashrc file.

  Now I keep getting the error:

  Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
          at SearchServer.main(SearchServer.java:50)

  for the following code:
  ------------
     public static void main(String [] args) {
       String indexPath = args[0];
       int port = 8076;

----------

  When I hard code the path with the following, the server starts fine.
  String indexPath = "/var/www/html";

  My question now is why am I getting the above out of bounds exception
and how can I correct it? How do I pass the path to my main method?

  Thanks
  Frank

softwareengineer 99 <removed_email_address@domain.invalid> wrote:  Erik,
  Thanks for your email.

  I removed the duplicate jar file and downloaded xmlrpc-2.0.jar
(instead  of v 3) and it compiled without any errors. I guess there is
some issue  with XMLRPC-3? Thank you very much for the tip.

  Now I have it compiled, I would like to customize the server and start
it so I can query it.

  Do I just put the lucene indexing methods in the searchServer.java?
  Is there an example code for indexing databases? Any reference
/pointers are highly appreciated.

  How do I start the server? I tried java SearchServer.java but it
complains about:

  Exception in thread "main" java.lang.NoClassDefFoundError

  Thank you so much once again. I obviously owe you ;)

  Thanks
  Frank

Erik H. <removed_email_address@domain.invalid> wrote:
On Feb 22, 20   06, at   5:09 PM, softwareengineer 99 wrote:
> Many thanks for your reply. I can imagine how "rare" a "few free
> minutes" can be and certainly appreciate your assistance.
>
> I placed the .jar files for Lucene and XML-RPC in my classpath and
> tried to compile the SearchServer.java with:
>
> javac -cp /var/java/jdk1.5.0_06/lib/lucene-1.4.3.jar:/var/java/
> jdk1.5.0_06/lib/xmlrpc-3.0a1.jar:/var/java/jdk1.5.0_06/lib/lucene-
> core-1.9-rc1.jar /var/java/development/SearchServer.java

You have two different versions of Lucene in your classpath.  Remove
one of them (I recommend you use 1.9RC1 instead of 1.4.3).   This
shouldn't be related to the compilation error you're getting...

> I keep getting the following error:
> -----------------
> /var/java/development/SearchServer.java:55: cannot find symbol
> symbol  : method addHandler(java.lang.String,SearchServer)
> location: class   org.apache.xmlrpc.webserver.WebServer
>        server.addHandler("$default", new SearchServer
>              ^
> 1 error

I just compiled my SearchServer using this command-line (normally I
use an Ant build file though):

$ javac -cp lib/lucene-core-1.9-rc1-dev.jar:lib/xmlrpc-2.0.jar src/
java/org/nines/SearchServer.java

And it compiled just fine.

 Erik

_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com

---------------------------------

   What are the most popular cars? Find out at Yahoo! Autos
_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
Ben M. (Guest)
on 2006-02-24 06:14
(Received via mailing list)
Heh, you're gonna laugh... the args array is command line args! Just run
your class like this:

java SearchServer /var/www/html

assuming that "/var/www/html" was the index path you wanted. That
command line also
assumes that you've resolved your library dependencies (those jars you
downloaded) some
way other than adding the classpath option to the command line. Sounds
like you already
figured that part out from your previous email.

b
softwareengineer 99 (Guest)
on 2006-02-24 18:08
(Received via mailing list)
Thanks Ben for the rescue.

  I can't believe I didn't figure it out especially cause PHP uses a
similar args array.

  The server compiles and runs but now I keep getting

  java.lang.NoClassDefFoundError:
org/apache/commons/codec/DecoderException

  I downloaded the following file
  wget
http://apache.mirrors.esat.net/java-repository/com...

  and placed it in my class path but to no avail.

  The full error when trying to call a test function is :

  Exception in thread "Thread-0" java.lang.NoClassDefFoundError:
org/apache/commons/codec/DecoderException
          at org.apache.xmlrpc.XmlRpc.createTypeFactory(XmlRpc.java:238)
          at org.apache.xmlrpc.XmlRpc.<init>(XmlRpc.java:193)
          at
org.apache.xmlrpc.XmlRpcRequestProcessor.<init>(XmlRpcRequestProcessor.java:40)
          at org.apache.xmlrpc.XmlRpcWorker.<init>(XmlRpcWorker.java:43)
          at
org.apache.xmlrpc.XmlRpcServer.createWorker(XmlRpcServer.java:180)
          at
org.apache.xmlrpc.XmlRpcServer.getWorker(XmlRpcServer.java:170)
          at
org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:136)
          at
org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:125)
          at
org.apache.xmlrpc.WebServer$Connection.run(WebServer.java:746)
          at org.apache.xmlrpc.WebServer$Runner.run(WebServer.java:626)
          at java.lang.Thread.run(Thread.java:595)


  Any ideas which dependency I am missing now?

  Thanks a zillion
  Frank


Ben M. <removed_email_address@domain.invalid> wrote:  Heh, you're gonna laugh... 
the args
array is command line args! Just run your class like this:

java SearchServer /var/www/html

assuming that "/var/www/html" was the index path you wanted. That
command line also
assumes that you've resolved your library dependencies (those jars you
downloaded) some
way other than adding the classpath option to the command line. Sounds
like you already
figured that part out from your previous email.

b



softwareengineer 99 wrote:
>
>
>
>
>
>          >
>          > symbol : method addHandler(java.lang.String,SearchServer)
>
>     *
>     _______________________________________________
> Linux / Security Blog: http://frankmash.blogspot.com*
> *
> ------------------------------------------------------------------------
> *
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
> *
_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
softwareengineer 99 (Guest)
on 2006-02-24 18:15
(Received via mailing list)
Sorry, I forgot to mention that on client side I keep getting the
following errors:


End of file reached


Once the test server works, I will be on my way to putting Lucene's
indexing and searching methods.

I highly appreciate your assistance.

Thanks
Frank



softwareengineer 99 <removed_email_address@domain.invalid> wrote:


Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
softwareengineer 99 (Guest)
on 2006-02-24 18:57
(Received via mailing list)
While researching online I found this thread where the thread owner had
the same issue as mine:

  http://mail-archives.apache.org/mod_mbox/ws-xmlrpc...

  However, I have tried to include the DecoderException class, and put
it in my class path, but my error persists?

  Any ideas are appreciated.

  Frank


Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
Ben M. (Guest)
on 2006-02-24 19:36
(Received via mailing list)
Sorry Frank... I'm pretty stumped too. If the commons-codec.jar is on
the classpath, it
should be found. And what really sucks is that you have a "no class
found" for an
*exception*... so even once you fix that, it'll be throwing an
exception. Well, I guess it
might be catching it too, so maybe that won't be a big deal.

Hmm, you say you "include the DecoderException class"... you don't mean
just the .class
file, right? If so, that won't do any good because the java package
system expects the
classes to be in their appropriate package directory. That's why they
have jars... jars
are just zip files. You can unzip it and look at the package (i.e.
directory) structure
inside. You might actually take a look inside the commons-codec jar and
make sure it has
DecoderException.

Sorry this is being so difficult.... Erik, you still lurking?

b
Andreas S. (Guest)
on 2006-02-24 20:18
softwareengineer 99 wrote:
> Ferret may be suitable - only testing (or real world use!) will tell.

I keep having problems with Ferret on ruby-forum.com. It's giving me
stale logfiles, occasional crashes, and exploding index files (from 3 to
60 MB after adding 3 new documents).
Erik H. (Guest)
on 2006-02-24 20:50
(Received via mailing list)
On Feb 24, 2006, at 12:35 PM, Ben M. wrote:
> Sorry this is being so difficult.... Erik, you still lurking?

Yes, I'm still lurking and reading infrequently.  Yes, Commons Codec
is needed on the classpath.  Provide us with the exact command-line
you're using to launch and perhaps I can help further, but we're
really talking about Java 101 here and it is perhaps abusing this
list to go into too many details on this when there are a plethora of
resources online that deal with this type of issue.  No offense
intended, just trying to direct you to the most appropriate resources
rather than messaging a list of Rails users that most could not care
less about Java.

Other than having XML-RPC, Lucene, and Commons Codec's JAR files on
the classpath you should be in good shape.  Our production
SearchServer (different from Nick's in underlying functionality, but
the same command-line interface) is launched like this:

java -cp build/nines.jar:lib/lucene-core-1.9-rc1-dev.jar:lib/commons-
codec-1.3.jar:lib/xmlrpc-2.0.jar
         org.nines.SearchServer <indexdir> [port number]

our nines.jar contains org.nines.SearchServer.

Best of luck with your SearchServer efforts.  Perhaps the free
codebase for Lucene in Action at http://www.lucenebook.com would help
you get rolling (lots of instructions on how to get the code running)
or the book would be the next step for you.  :)

	Erik
softwareengineer 99 (Guest)
on 2006-02-24 22:36
(Received via mailing list)
Hey Ben,

  Thanks for your reply.

  I have searched all over the web and cannot find any reason why I
should be getting that error. I have tried recompiling with different
versions too but no luck.

  >> Sorry Frank... I'm pretty stumped too.
  >>  If the commons-codec.jar is on the classpath, it   should be
found. And what really sucks is that you have a "no class  found" for an
  *exception*... so even once you fix that, it'll be throwing an
exception.


  Yes I have the commons-codec.jar file on the classpath. I am compiling
using the following:

  javac -cp
commons-codec-1.2.jar:/var/java/jdk1.5.0_06/lib/xmlrpc-2.0/xmlrpc-2.0.jar:/var/java/jdk1.5.0_06/lib/xmlrpc-2.0.jar:/var/java/jdk1.5.0_06/lib/lucene-core-1.9-rc1.jar:/var/java/jdk1.5.0_06/lib/commons-codec-1.2.jar
SearchServer.java



  >> Hmm, you say you "include the DecoderException class"... you don't
mean just the .class >>  file, right?

  Sorry for the confusion.  I meant to say I have the  following import
statements:

  import org.apache.commons.codec.DecoderException;
  import org.apache.commons.codec.*;


  >> You can unzip it and look at the package (i.e. directory)
structure  inside. You might actually take a look inside the
commons-codec jar and make sure it has  DecoderException.

  I unzipped the commons-codec.jar file and can see the DecoderException
class:


  [root@srv30 test]# unzip commons-codec-1.2.jar
  Archive:  commons-codec-1.2.jar
     creating: META-INF/
    inflating: META-INF/MANIFEST.MF
     creating: org/
     creating: org/apache/
     creating: org/apache/commons/
     creating: org/apache/commons/codec/
     creating: org/apache/commons/codec/binary/
     creating: org/apache/commons/codec/language/
     creating: org/apache/commons/codec/net/
     creating: org/apache/commons/codec/digest/
    inflating: org/apache/commons/codec/BinaryDecoder.class
    inflating: org/apache/commons/codec/Decoder.class
    inflating: org/apache/commons/codec/DecoderException.class
    inflating: org/apache/commons/codec/BinaryEncoder.class
    inflating: org/apache/commons/codec/Encoder.class
    inflating: org/apache/commons/codec/EncoderException.class
    inflating: org/apache/commons/codec/StringEncoder.class
    inflating: org/apache/commons/codec/StringEncoderComparator.class
    inflating: org/apache/commons/codec/binary/Base64.class
    inflating: org/apache/commons/codec/binary/Hex.class
    inflating:
org/apache/commons/codec/language/DoubleMetaphone$DoubleMetaphoneResult.class
    inflating: org/apache/commons/codec/language/DoubleMetaphone.class
    inflating: org/apache/commons/codec/language/Metaphone.class
    inflating: org/apache/commons/codec/language/RefinedSoundex.class
    inflating: org/apache/commons/codec/language/Soundex.class
    inflating: org/apache/commons/codec/net/URLCodec.class
    inflating: org/apache/commons/codec/StringDecoder.class
    inflating: org/apache/commons/codec/digest/DigestUtils.class
    inflating: META-INF/LICENSE.txt


  I should also point that I have tried both version 1.2 and 1.3 of the
codec file and that the errors do not happen unless a call is made from
my XML-RPC client.


  >> Sorry this is being so difficult.... Erik, you still lurking?

  Thank you so much to you, Erik and Nick for your assistance so far. I
would love to move forward once my test call goes without any error.


  I am also asking the same question on JGuru forum but so far no luck.
If I get an answer I will post it here.

  Thanks again guys.

  Frank


Ben M. <removed_email_address@domain.invalid> wrote: Well, I guess it
might be catching it too, so maybe that won't be a big deal.



Sorry this is being so difficult.... Erik, you still lurking?

b

softwareengineer 99 wrote:
> Frank
> used cars.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
softwareengineer 99 (Guest)
on 2006-02-24 22:51
(Received via mailing list)
Hey Erik and fellow list members

  I was only posting and asking here thinking that someone later may be
able to benefit from this discussion as they try to implement Lucene
with ROR . My apologies if you thought I am abusing the list.

  >> Yes, I'm still lurking and reading infrequently.  Yes, Commons
Codec
  is needed on the classpath.

  My compile command:
  javac -cp
commons-codec-1.2.jar:/var/java/jdk1.5.0_06/lib/xmlrpc-2.0/xmlrpc-2.0.jar:/var/java/jdk1.5.0_06/lib/xmlrpc-2.0.jar:/var/java/jdk1.5.0_06/lib/lucene-core-1.9-rc1.jar:/var/java/jdk1.5.0_06/lib/commons-codec-1.2.jar
SearchServer.java

  My import statements:
  import org.apache.commons.codec.DecoderException;
  import org.apache.commons.codec.*;

  My server execution command

  java SearchServer /var/www/html


  >> No offense
  intended, just trying to direct you to the most appropriate resources
  rather than messaging a list of Rails users that most could not care
  less about Java.


  No offense taken. Thanks for your assistance any way. I will take my
questions else where (I am already trying on other lists and thought
someone here may have the solution).

  I would like to buy your book but would like to compile my test
program first.

  Nonetheless my apologies to the list members..

  Frank

Erik H. <removed_email_address@domain.invalid> wrote:

Other than having XML-RPC, Lucene, and Commons Codec's JAR files on
the classpath you should be in good shape.  Our production
SearchServer (different from Nick's in underlying functionality, but
the same command-line interface) is launched like this:

java -cp build/nines.jar:lib/lucene-core-1.9-rc1-dev.jar:lib/commons-
codec-1.3.jar:lib/xmlrpc-2.0.jar
         org.nines.SearchServer  [port number]

our nines.jar contains org.nines.SearchServer.

Best of luck with your SearchServer efforts.  Perhaps the free
codebase for Lucene in Action at http://www.lucenebook.com would help
you get rolling (lots of instructions on how to get the code running)
or the book would be the next step for you.  :)

 Erik


>> Any ideas are appreciated.
>> ---------------------------------------------------------------------
>> ---
>> _______________________________________________
>> Rails mailing list
>> removed_email_address@domain.invalid
>> http://lists.rubyonrails.org/mailman/listinfo/rails
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails

_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails



Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
Derek DeVries (Guest)
on 2006-02-25 03:17
(Received via mailing list)
Frank,
I ironically enough have been trying to solve the exact same problem
as you and am completely Java illiterate as well. With the help of the
list threads (and Erik's book), I've actually got this working now on
my development environment (os-x).

I'm using java version "1.4.2_09" and used the following jars:
lucene-1.4.3.jar
commons-codec-1.3.jar
xmlrpc-2.0.1.jar

I now have ruby performing remote procedure calls to the java like a
charm. Feel free to e-mail me offlist if you are still having
troubles.

Derek
softwareengineer 99 (Guest)
on 2006-02-28 08:53
(Received via mailing list)
I wanted to let the list know that I have the search server working
now. Thank you so much for all the off-list replies I received from
members of this great list offering support.

  I have the search server communicating with my ROR project and my
indices are  ready to go.

  I bought Erik's wonderful book which is just amazingly full of
information. Not to mention its 457 pages long.

  Erik goes in to a lot of detail about almost everything you will need.

  For e.g., I was thinking about searching multiple fields in Lucene but
after reading Erik's thoughts, I decided to combine the information in
a contents field.


  My wish list :

  I hope Erik updates the book so it doesn't include deprecated function
calls such as:

  Field.UnIndexed (...)
  Field.Text (...)

  instead of

  new Field(...)

  which causes the Java compiler to issue the following messages on
compile (at least when using Lucene 1.9):

  Note: SearchServer.java uses or overrides a deprecated API.
  Note: Recompile with -Xlint:deprecation for details.

  Nonetheless, this book is a must-have for any application developer.
Don't let the complexity of Java stop you from using Lucene.

    My solution to Lucene indexing databases is ready and I am willing
to provide any  help I can about the implementation. Please message me
if you would  like sample code (I plan to post it soon on my blog).

  Thanks Erik, Ben, Nick  and everyone who offered their help. You guys
are a great help.

  Frank


Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com
Erik H. (Guest)
on 2006-02-28 22:20
(Received via mailing list)
On Feb 28, 2006, at 1:53 AM, softwareengineer 99 wrote:
> I bought Erik's wonderful book which is just amazingly full of
> information. Not to mention its 457 pages long.
>
> Erik goes in to a lot of detail about almost everything you will need.

Thanks for the kind words!

> For e.g., I was thinking about searching multiple fields in Lucene
> but after reading Erik's thoughts, I decided to combine the
> information in a contents field.

This all really depends on what you're doing and how the user needs
to interact with the system.  For most general purpose searching
needs, a user simply wants to enter keywords and find stuff, doesn't
want to bother with selecting precise fields to narrow things down.
So a catch-all "contents" field often is the best way to go (though I
also do this in conjunction with separate fields for the advanced
cases where constraining more precisely is desired).

> new Field(...)
>
> which causes the Java compiler to issue the following messages on
> compile (at least when using Lucene 1.9):
>
> Note: SearchServer.java uses or overrides a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.

Yes, we will be updating the book for the new 2.0 revision of Lucene
coming out soon.  The book was written for Lucene 1.4.3, and Lucene
1.9 *just* came out today unofficially, and officially so in the next
few days.  1.9 is backwards compatible with 1.4.3 and forwards
compatible with the impending 2.0 release where we will sweep up and
remove all the deprecated API.  Deprecation warnings in the Lucene
case are harmless, so no worries with seeing those at all and you
could turn off those warnings with a compiler switch if you like :)

	Erik
This topic is locked and can not be replied to.