I'm having trouble with PerFieldAnalyzer (ferret version 0.10.14).
Script:
require 'rubygems'
require 'ferret'
require 'pp'
include Ferret::Analysis
include Ferret::Index
class TestAnalyzer
def token_stream field, input
pp field
pp input
LetterTokenizer.new(input)
end
end
pfa = PerFieldAnalyzer.new(StandardAnalyzer.new())
pfa[:test] = TestAnalyzer.new
index = Index.new(:analyzer => pfa)
index << {:test => 'foo'}
index.search_each('bar')
Output:
:test
""
:test
"bar"
Why is input "" the first time token_stream is called?
I hope that the answer isn't "upgrade to 0.11". :(
-ryan
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk