Okay, let's drop it back another level - no Thinking Sphinx, but using
Ruby via Riddle to talk to Sphinx. Within script/console:
client = Riddle::Client.new "localhost", 3312
client.match_mode = :extended
client.query("fusbal", "product_core")[:matches]
--
Pat
On 30/03/2009, at 12:39 AM, Jochen Kaechelin wrote:
>
>
> Am 29.03.2009 um 15:28 schrieb Pat Allan:
>
>>
>> Okay, let's strip it back to the minimum. What's the output of the
>> following in script/console:
>>
>> Product.search "fusbal"
>
> bullet:quamm bullet$ script/console
> Loading development environment (Rails 2.3.2)
>>> Product.search "fusbal"
> => []
>>>
>
>>
>> And if we add some complexity...
>>
>> Product.search "fusbal",
>> :with => {:active => 1},
>> :match_mode => :extended
>>
>
>>> Product.search "fusbal", :with => {:active =>1}, :match_mode
> => :extended
> => []
>>>
>
> Searching for the correct word (fussball):
>
>>> Product.search "fussball", :with => {:active =>1}, :match_mode
> => :extended
> => [#<Product id: 813, worker_id: 99999, brand_id: 1, kadisnr:
> "112335", order_number: "GT2739", kadis_product: " Zucker-Fussball-
> Elf, gemischt", description: "B: 30 / H 41 mm", day_special_date: nil,
> day_special_price: nil, hide_at: nil, visible_at: nil, delta: false,
> boost: "0", active: true, available_at: nil, created_at: "2009-03-16
> 15:36:04", updated_at: "2009-03-20 02:31:02", recommend: false>,
> #<Product id: 9074, worker_id: 99999, brand_id: 1, kadisnr: "113999",
> order_number: "GT2739-24", kadis_product: " Zucker-Fussball-Elf,
> gemischt", description: "B: 30 / H 41 mm", day_special_date: nil,
> day_special_price: nil,
>
> ...
>
> searchd.query.log:
>
> [Sun Mar 29 15:38:11.341 2009] 0.002 sec [ext/3/rel 0 (0,20)] [*]
> fusbal
> [Sun Mar 29 15:38:11.341 2009] 0.002 sec [ext/3/rel 0 (0,20)] [*]
> fusbal
> [Sun Mar 29 15:38:40.058 2009] 0.045 sec [ext/3/rel 19 (0,20)] [*]
> fussball
>
>
>> --
>> Pat
>>
>> On 29/03/2009, at 11:51 PM, Jochen Kaechelin wrote:
>>
>>>
>>>
>>> Am 29.03.2009 um 14:48 schrieb Pat Allan:
>>>
>>>>
>>>> Okay, that seems to be working (that's the result you're expecting,
>>>> yes?).
>>>
>>> Yes - exactly what I'am looking for.
>>>
>>>> Just to confirm, what's the line of code in Ruby when you're
>>>> searching for fusball?
>>>>
>>>
>>> @products = Product.search params[:query]+"*",
>>> :conditions => { :active => 1 },
>>> :match_mode => :extended2,
>>> :page => params[:page],
>>> :per_page => 20,
>>> :field_weights => { :boost => 200, :kadis_product =>
>>> 100, :description => 10 },
>>> :include => :taggings
>>>
>>>
>>>
>>>>
>>
>>
>>>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---