On 3/28/07, Ryan King <[EMAIL PROTECTED]> wrote:
> 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". :(
FWIW, I upgraded to 0.11.3 on my test box and it didnt' change
anything. Are my assumptions about PFA wrong? Or is there a bug?
-ryan
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk