Hi all,

I've posted that few weeks ago but no one answered, but this feature is
REALLY important for us.

I have many objects with a url field, of course containing standards
urls...
I'm trying to match them but i actually got problems with that.

Here's a little code of what i would like to achieve:
require 'rubygems'
require 'ferret'
require 'ftools'

class TestAnalyzer
  def token_stream(field, str)
    ts = Ferret::Analysis::AsciiStandardTokenizer.new(str)
    ts = Ferret::Analysis::AsciiLowerCaseFilter.new(ts)
  end
end

system 'rm -rf /tmp/ferret_test' if File.exists?('/tmp/ferret_test')
File.mkpath('/tmp/ferret_test')
INDEX = Ferret::I.new(:path => '/tmp/ferret_test', :analyzer =>
TestAnalyzer.new)
INDEX << {:type => :url, :url => 'http://google.fr'}
INDEX << {:type => :url, :url => 'http://ferret.davebalmain.com'}
INDEX << {:type => :url, :url => 'http://www.unixaumonde.com'}
INDEX << {:type => :url, :url => 'http://www.rift.fr'}

['type:url AND url:*google*',
 'type:url AND url:*"://foobar"*',
 'type:url AND url:"http://goo"*',
 'type:url AND url:"http://goo*";'].each do |q|
  puts "\nSearching #{q}"
  INDEX.search(q).hits.each { |x| p INDEX[x.doc].load }
  puts "\n"
end

I hope Dave or anyone else will be able to give us an hint or a release,
something like this..

Regards,
Jeremie 'ahFeel' BORDIER
Rift Technologies

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to