# Ruby/RoR - Lucene integration question?

**URL:** <https://www.ruby-forum.com/t/ruby-ror-lucene-integration-question/48356>\
**Category:** Ruby\
**Created:** [November 19, 2005, 9:49am UTC](https://www.ruby-forum.com/t/ruby-ror-lucene-integration-question/48356 "2005-11-19T09:49:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![phukan\_ruban](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dec6dc/32.png) [@phukan\_ruban](https://www.ruby-forum.com/u/phukan_ruban)\
**Post date:** [November 19, 2005, 9:49am UTC](https://www.ruby-forum.com/t/ruby-ror-lucene-integration-question/48356/1 "2005-11-19T09:49:43Z")

</div>

Hi,

I’ve an application which is built with RoR and a search index in  
Lucene. I need to be able to integrate Lucene into the RoR app. What is  
the best way to do so ?

I know that rjni is a ruby-java bridge but is it stable ? Also the  
update at [http://thekode.net/ruby/rjni/](http://thekode.net/ruby/rjni/) seems to indicate that it is no  
longer under development.

Thanks.

Ruban.

---

<div class="post-metadata">

**Author:** ![phukan\_ruban](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dec6dc/32.png) [@phukan\_ruban](https://www.ruby-forum.com/u/phukan_ruban)\
**Post date:** [November 19, 2005, 10:13am UTC](https://www.ruby-forum.com/t/ruby-ror-lucene-integration-question/48356/2 "2005-11-19T10:13:51Z")

</div>

On Sat, Nov 19, 2005 at 05:49:20PM +0900, Ruban Phukan wrote:

> I’ve an application which is built with RoR and a search index in  
> Lucene. I need to be able to integrate Lucene into the RoR app. What  
> is the best way to do so ?
> 
> I know that rjni is a ruby-java bridge but is it stable ? Also the  
> update at [http://thekode.net/ruby/rjni/](http://thekode.net/ruby/rjni/) seems to indicate that it is  
> no longer under development.

rjni is dead.  
Try rjb:

[http://arton.no-ip.info/collabo/backyard/?RubyJavaBridge](http://arton.no-ip.info/collabo/backyard/?RubyJavaBridge)  
[http://raa.ruby-lang.org/project/rjb](http://raa.ruby-lang.org/project/rjb)

You can find an excellent review of Ruby-Java bridges and related tools  
at  
[http://jp.rubyist.net/magazine/?0003-RLR](http://jp.rubyist.net/magazine/?0003-RLR) (Japanese).

---

<div class="post-metadata">

**Author:** ![phukan\_ruban](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dec6dc/32.png) [@phukan\_ruban](https://www.ruby-forum.com/u/phukan_ruban)\
**Post date:** [November 19, 2005, 10:28am UTC](https://www.ruby-forum.com/t/ruby-ror-lucene-integration-question/48356/3 "2005-11-19T10:28:56Z")

</div>

Just actually read a bit about Lucene after your post, and found that  
there  
is a new port called Ferret which you may find interesting.

Seems CDBaby went down this same path,  
[O'Reilly Media - Technology and Business Training](http://www.oreillynet.com/pub/wlg/8168).

Might be a more effective shift to move from Lucene to Ferrett then  
build a  
Ferrett gem to integrate into Rails. I am sure this would be well  
received  
open project in the Rails community 🙂

[http://ferret.davebalmain.com/trac](http://ferret.davebalmain.com/trac)

Warmest regards,  
Nathan.

* * *

Nathaniel S. H. Brown Toll Free 1.877.4.INIMIT  
Inimit Innovations Phone 604.724.6624  
[www.inimit.com](http://www.inimit.com) Fax 604.444.9942

---

<div class="post-metadata">

**Author:** ![phukan\_ruban](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dec6dc/32.png) [@phukan\_ruban](https://www.ruby-forum.com/u/phukan_ruban)\
**Post date:** [November 19, 2005, 7:37pm UTC](https://www.ruby-forum.com/t/ruby-ror-lucene-integration-question/48356/4 "2005-11-19T19:37:47Z")

</div>

iamkris wrote:

> I am to embark on a similar project. Just started reading on it. Isn’t  
> the index file created by Lucene readable from Ruby?

As I have understood it, Ferret is a full port of Lucene, so you should  
be able to use the same index file from Lucene and Ferret.

---

<div class="post-metadata">

**Author:** ![phukan\_ruban](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dec6dc/32.png) [@phukan\_ruban](https://www.ruby-forum.com/u/phukan_ruban)\
**Post date:** [November 19, 2005, 7:34pm UTC](https://www.ruby-forum.com/t/ruby-ror-lucene-integration-question/48356/5 "2005-11-19T19:34:21Z")

</div>

I am to embark on a similar project. Just started reading on it. Isn’t  
the index file created by Lucene readable from Ruby? I was planning to  
index the files via Lucene and use Ruby to read the index file or if I  
cannot read the index file from Ruby I plan to expose a webservice from  
the Java side and consume it from the Ruby side. Looking at  
Nathaniel’s post about CDBaby, I think I am on the right path.

I am looking at Ferret too but I think Lucene is more matured.

---

<div class="post-metadata">

**Author:** ![phukan\_ruban](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dec6dc/32.png) [@phukan\_ruban](https://www.ruby-forum.com/u/phukan_ruban)\
**Post date:** [November 20, 2005, 3:44am UTC](https://www.ruby-forum.com/t/ruby-ror-lucene-integration-question/48356/6 "2005-11-20T03:44:30Z")

</div>

On 11/20/05, Kris [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am to embark on a similar project. Just started reading on it. Isn’t  
> the index file created by Lucene readable from Ruby?

Hi Kris,  
Andreas is correct in stating that Ferret can read the index from Ruby.

> I was planning to  
> index the files via Lucene and use Ruby to read the index file or if I  
> cannot read the index file from Ruby I plan to expose a webservice from  
> the Java side and consume it from the Ruby side. Looking at  
> Nathaniel’s post about CDBaby, I think I am on the right path.

Why use Lucene to index the files when you can use Ferret. If it’s  
speed you are concerned about, it shouldn’t be a problem by the end of  
the month. Ferret should be faster than Lucene by then. One good  
reason I can think of is that you’ll have better support in Java for  
indexing PDF’s and Microsoft Office Docs. And Unicode is easier in  
Java.

> I am looking at Ferret too but I think Lucene is more matured.

This is true in terms of possible bugs. But the index file format and  
API are the same.

Anyway, I wish you the best, whatever choice you make.

Cheers,  
Dave
