acts_as_ferret problems

I recently installed ferret and the acts_as_ferret plugin but I'm getting results that I just don't understand. The model I'm using is for products. The table contains fields 'name', 'description', 'sku', 'model'. This is what I have put in my model:

acts_as_ferret :fields => { :sku => {}, :model => {}, 'name' => { :boost => 2, :store => Ferret::Document::Field::Store::YES }, 'description' => { :boost => 1.5, :store => Ferret::Document::Field::Store::YES } }, :store_class_name => true

I have a couple of products called: product 1: Armored Troopers Votoms Red Scopedog EX-01 Action Figure product 2: Fate/Hollow Ataraxia Sakura Matou Grocery Shopping PVC Statue

If I search for 'Armored', it comes back correctly with product 1. If I search for 'Votoms', it comes back with NOTHING If I search for 'figure', it comes back with product 1 If I search for 'Scopego', it comes back with NOTHING

Similarly:

If I search for 'fate', it comes back with product 2 If I search for 'shopping' it comes back with NOTHING If I search for 'statue' it comes back with product 2

I'm really not getting the logic with why it's doing that. It seems like it's catching words that are in the beginning and near the end of the product names, but not the middle. I'm not really familiar with how ferret's search algorithm works, but I'm assuming (yes, not a good idea!) that it searches the entire product name.

Any help with this would be greatly appreciated. Thanks!

Best Regards,

Tamim

Umm, has no one used the acts_as_ferret plugin? Well, since no one has responded to the original question below, I'm wondering what you guys are using as the search engine for your sites. Any input would be greatly appreciated. Thanks.

Best Regards,

Tamim

Tamim Azizadah wrote:

Tamim,

I must admit I am not a Ferret/Lucene expert by any means but I will share my little knowledge if it helps you. I’m using ferret and the plugin and I must say that it makes things really easy if you have simple requirements. The project I am working on is more complex than “simple requirements” but after a lot of digging in the code I have figured almost all the things that I need. Check the code for the plugin and for ferret and you will see that you can modify the analyzers/tokenizers (how you analyze a query and how you separate the query into words). For example, the standard query looks for non-alphanumeric characters to separate words. So “Fate/Hollow” would be recognized as two separate words. Also I think you might have misspelled your example when you searched for “Scopego” and your product is named “Scopedog”. I must say, though, that if you searched for “Scopedo” it would not find anything but if you searched for “Scopedo*” it should find your product. I’m still a ways to go on my project but so far I have been pleased greatly with ferret. My only concern is that there have been a few segfaults here and there but the developer tells me that things like that will get ironed out by the stable release.

Hope this helps a bit,

Adrian Madrid