You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ruby-dev@lucene.apache.org by Erik Hatcher <er...@ehatchersolutions.com> on 2005/10/21 22:51:00 UTC

Fwd: [Fwd: [ANN] Ferret 0.1.0 (Port of Java Lucene) released]

How about this?!   I haven't tried it yet.  Experiences?



Begin forwarded message:
>> From: David Balmain <db...@gmail.com>
>> Reply-To: ruby-talk@ruby-lang.org
>> To: ruby-talk ML <ru...@ruby-lang.org>
>> Subject: [ANN] Ferret 0.1.0 (Port of Java Lucene) released
>> Date: Fri, 21 Oct 2005 11:36:15 +0900
>>
>> Hi Folks,
>>
>> I know there have been at least a few people looking for something  
>> like this
>> on the mailing list, so please check it out. It's a port of a Java  
>> project
>> so I'd particularly like to hear how I can make it more Ruby like.  
>> Enjoy!
>>
>> Dave Balmain
>>
>> == Description
>>
>> Ferret is a full port of the Java Lucene searching and indexing  
>> library.
>> It's available as a gem so try it out! To get started quickly read  
>> the quick
>> start at the project homepage;
>>
>> http://ferret.davebalmain.com/trac/
>>
>> == Quick (Very Simple) Example
>>
>> require 'ferret'
>>
>> include Ferret
>>
>> docs = [
>> { :title => "The Pragmatic Programmer",
>> :author => "Dave Thomas, Andy Hunt",
>> :tags => "Programming, Broken Windows, Boiled Frogs",
>> :published => "1999-10-13",
>> :content => "Yada yada yada ..."
>> },
>> { :title => "Programming Ruby",
>> :author => "Dave Thomas, Chad Fowler, Andy Hunt",
>> :tags => "Ruby",
>> :published => "2004-10-06",
>> :content => "Yada yada yada ..."
>> },
>> { :title => "Agile Web Development with Rails",
>> :author => "Dave Thomas, David Heinemeier Hansson, Leon Breedt,  
>> Mike Clark,
>> Thomas Fuchs, Andreas Schwarz",
>> :tags => "Ruby, Rails, Web Development",
>> :published => "2005-07-13",
>> :content => "Yada yada yada ..."
>> },
>> { :title => "Ruby, Developer's Guide",
>> :author => "Robert Feldt, Lyle Johnson, Michael Neumann",
>> :tags => "Ruby, Racc, GUI, FOX",
>> :published => "2002-10-06",
>> :content => "Yada yada yada ..."
>> },
>> { :title => "Lucene In Action",
>> :author => "Otis Gospodnetic, Erik Hatcher",
>> :tags => "Lucene, Java, Search, Indexing",
>> :published => "2004-12-01",
>> :content => "Yada yada yada ..."
>> }
>> ]
>>
>> index = Index::Index.new()
>>
>> docs.each {|doc| index << doc }
>>
>> puts index.size
>>
>> puts "\nFind all documents on ruby:-"
>> index.search_each("tags:Ruby") do |doc, score|
>> puts "Document <#{index[doc]["title"]}> found with a score of % 
>> 0.2f" % score
>> end
>>
>> puts "\nFind all documents on ruby published this year:-"
>> index.search_each("tags:ruby AND published: >= 2005") do |doc, score|
>> puts "Document <#{index[doc]["title"]}> found with a score of % 
>> 0.2f" % score
>> end
>>
>> puts "\nFind all documents by the Pragmatic Programmers:-"
>> index.search_each('author:("dave Thomas" AND "Andy hunt")') do | 
>> doc, score|
>> puts "Document <#{index[doc]["title"]}> found with a score of % 
>> 0.2f" % score
>> end
>


Re: [Fwd: [ANN] Ferret 0.1.0 (Port of Java Lucene) released]

Posted by Brian McCallister <br...@apache.org>.
On Oct 21, 2005, at 1:51 PM, Erik Hatcher wrote:

> How about this?!   I haven't tried it yet.  Experiences?

Just tried it out, it is bloody nice! I haven't tested binary  
compatible of indexes yet, but it works a charm by itself. His  
disclaimers about speed are very true -- indexing is *slow* -- so I  
hope binary compatibility is there =-)

-Brian

> Begin forwarded message:
>
>>> From: David Balmain <db...@gmail.com>
>>> Reply-To: ruby-talk@ruby-lang.org
>>> To: ruby-talk ML <ru...@ruby-lang.org>
>>> Subject: [ANN] Ferret 0.1.0 (Port of Java Lucene) released
>>> Date: Fri, 21 Oct 2005 11:36:15 +0900
>>>
>>> Hi Folks,
>>>
>>> I know there have been at least a few people looking for  
>>> something like this
>>> on the mailing list, so please check it out. It's a port of a  
>>> Java project
>>> so I'd particularly like to hear how I can make it more Ruby  
>>> like. Enjoy!
>>>
>>> Dave Balmain
>>>
>>> == Description
>>>
>>> Ferret is a full port of the Java Lucene searching and indexing  
>>> library.
>>> It's available as a gem so try it out! To get started quickly  
>>> read the quick
>>> start at the project homepage;
>>>
>>> http://ferret.davebalmain.com/trac/
>>>
>>> == Quick (Very Simple) Example
>>>
>>> require 'ferret'
>>>
>>> include Ferret
>>>
>>> docs = [
>>> { :title => "The Pragmatic Programmer",
>>> :author => "Dave Thomas, Andy Hunt",
>>> :tags => "Programming, Broken Windows, Boiled Frogs",
>>> :published => "1999-10-13",
>>> :content => "Yada yada yada ..."
>>> },
>>> { :title => "Programming Ruby",
>>> :author => "Dave Thomas, Chad Fowler, Andy Hunt",
>>> :tags => "Ruby",
>>> :published => "2004-10-06",
>>> :content => "Yada yada yada ..."
>>> },
>>> { :title => "Agile Web Development with Rails",
>>> :author => "Dave Thomas, David Heinemeier Hansson, Leon Breedt,  
>>> Mike Clark,
>>> Thomas Fuchs, Andreas Schwarz",
>>> :tags => "Ruby, Rails, Web Development",
>>> :published => "2005-07-13",
>>> :content => "Yada yada yada ..."
>>> },
>>> { :title => "Ruby, Developer's Guide",
>>> :author => "Robert Feldt, Lyle Johnson, Michael Neumann",
>>> :tags => "Ruby, Racc, GUI, FOX",
>>> :published => "2002-10-06",
>>> :content => "Yada yada yada ..."
>>> },
>>> { :title => "Lucene In Action",
>>> :author => "Otis Gospodnetic, Erik Hatcher",
>>> :tags => "Lucene, Java, Search, Indexing",
>>> :published => "2004-12-01",
>>> :content => "Yada yada yada ..."
>>> }
>>> ]
>>>
>>> index = Index::Index.new()
>>>
>>> docs.each {|doc| index << doc }
>>>
>>> puts index.size
>>>
>>> puts "\nFind all documents on ruby:-"
>>> index.search_each("tags:Ruby") do |doc, score|
>>> puts "Document <#{index[doc]["title"]}> found with a score of % 
>>> 0.2f" % score
>>> end
>>>
>>> puts "\nFind all documents on ruby published this year:-"
>>> index.search_each("tags:ruby AND published: >= 2005") do |doc,  
>>> score|
>>> puts "Document <#{index[doc]["title"]}> found with a score of % 
>>> 0.2f" % score
>>> end
>>>
>>> puts "\nFind all documents by the Pragmatic Programmers:-"
>>> index.search_each('author:("dave Thomas" AND "Andy hunt")') do | 
>>> doc, score|
>>> puts "Document <#{index[doc]["title"]}> found with a score of % 
>>> 0.2f" % score
>>> end
>>>
>>
>>
>
>