I can consistently segfault the 0.10.4 gem, so I’m trying to get the
subversion version working with hopes towards tracking the problem down.
I have a fresh SVN checkout but:
a) the version (in ferret.rb) claims to be 0.9.6; and
b) Ferret::Index::FieldInfos and a couple other classes are missing at
run time. It looks like this is because they’re not exported in the C
extension (although I do see the corresponding C objects in the
code.)
Have I managed to acquire some outdated version of Ferret?
Excerpts from David B.'s mail of 24 Sep 2006 (PDT):
Did you rebuild the index? You’ll need to do that before it makes any
difference.
Yes, the original example now works—thanks! Unfortunately, I still see
a lot of queries that return nothing in TermQuery form, but work fine in
String form.
Excerpts from David B.'s mail of 26 Sep 2006 (PDT):
You need to downcase the term when you add it to a TermQuery. The
StandardAnalyzer downcases all text so you need to do the same with
any terms you add to any hand built queries.
Thanks for the response. Downcasing the string passed into the TermQuery
does, in fact, retrieve the document. BUT, I had used a
WhitespaceAnalyzer with no downcasing on that field, so it should have
preserved case in the index.
So it looks like WSA#token_stream does the right thing. Is it possible
isn’t not actually being called at insertion time? Or am I
misunderstanding something?
You need to downcase the term when you add it to a TermQuery. The
StandardAnalyzer downcases all text so you need to do the same with
any terms you add to any hand built queries.
One way to see what might possibly be wrong is to run the term through
the analyzer yourself.
So it looks like WSA#token_stream does the right thing. Is it possible
isn’t not actually being called at insertion time? Or am I
misunderstanding something?
Ok, this is definitely a a bug. I’ve already fixed it and it’ll be out
in the next release. By the way, you probably already know this but
you can set the analyzer used by the index.
Ferret::Index::Index.new(:analyzer => wsa)
You probably have a good reason to be doing it the way you are but I
just wanted to check.