Inconsistant Search Results

Hi,

I have this maddening strange bug using acts_as_ferret. If I search for
a given phrase (let’s say “xyz”) I get one set of results (lets call
them set A). I search for xyz again and I get set A again. I search for
xyz a third time and I get a different set (set B).

I can keep executing the search query and my result sets continue to
cycle a-a-b-a-a-b-a-a-b.

It’s really strange. ‘a’ is the correct set of results, ‘b’ is related
but contains some incorrect results too. I am using the fuzzy search
algorithm by appending ‘~’ to each word in the query executed with
acts_as_ferrets find_by_contents. I am the only user of the server so
nothing is being added to the index while I search. I am using rails
1.2RC1 the newest ferret and acts_as_ferret.

Any ides?

Thanks,
Scott

On Tue, Jan 02, 2007 at 08:49:26PM +0100, Scott Fortmann-roe wrote:

It’s really strange. ‘a’ is the correct set of results, ‘b’ is related
but contains some incorrect results too. I am using the fuzzy search
algorithm by appending ‘~’ to each word in the query executed with
acts_as_ferrets find_by_contents. I am the only user of the server so
nothing is being added to the index while I search. I am using rails
1.2RC1 the newest ferret and acts_as_ferret.

Any ides?

could you try to reproduce this behaviour with a plain ruby script only
using Ferret directly? I think it’s a problem related to Ferret itself.

cheers,
Jens


webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer [email protected]
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66

could you try to reproduce this behaviour with a plain ruby script only
using Ferret directly? I think it’s a problem related to Ferret itself.

cheers,
Jens

I would be happy to but I am having a little bit of a hard time figuring
out how to search the acts_as_ferret index using ferret by itself. Could
you offer some guidance on this. (It seemed like ferret use to have a
Search::IndexSearcher class that no longer exists, what do I use
instead? The acts_as_ferret source is very convoluted)

Thanks, Scott

Ok, I accessed and carried out searches using Ferret alone. The same
a-a-b-a-a-b cyclical patten of results to repeated searches occurred
with two different sets of results being returned.

It only occurs when I am searching for “xyz~” search for “xyz” by itself
always returns the same results.

So it looks like a ferret issue. Any ideas how to fix this?

thanks, Scott

On Thu, Jan 04, 2007 at 12:25:17AM +0100, Scott Fortmann-roe wrote:

you offer some guidance on this. (It seemed like ferret use to have a
Search::IndexSearcher class that no longer exists, what do I use
instead? The acts_as_ferret source is very convoluted)

require ‘rubygems’
require ‘ferret’
index = Ferret::I.new(:path => ‘path/to/ferret/index/dir’)
index.search(‘querystring here’)

easiest is to do this in irb.

Jens


webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer [email protected]
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66