🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.ruby
2 messages
2 total messages Started by thinval Wed, 25 Oct 2006 15:02
acts_as_ferret i highlight, czy komus udalo sie uzyskac cos innego niz nil?
#258
Author: thinval
Date: Wed, 25 Oct 2006 15:02
34 lines
1448 bytes
witajcie,

pytanie bardziej railsowe niz konkretnie odnosnie samego jezyka,
ale moze ktos bedzie potrafil mi pomoc...

czy udalo sie komus was uruchomic podswietlanie w wynikach wyszukiwania,
zwroconych przez ferret/acts_as_ferret?

class Foo < ActiveRecord::Base
     acts_as_ferret  :fields => [ 'name', 'text' ]
end

i teraz

 >> ppp = Foo.find(:first)
ppp = Foo.find(:first)
=> #<Foo:0x342cd24 @attributes={"name"=>"kontakt", "text"=>"to jest
testowy tekst"}>

?> ppp.name
ppp.name
=> "kontakt"

 >> ppp.highlight('testowy')
ppp.highlight('testowy')
=> []

czy to jakis blad, czy ja robie cos nie tak?

Foo.find_by_contents dziala o.k.

pozdrawiam serdecznie
t.
Re: acts_as_ferret i highlight, czy komus udalo sie uzyskac cos innego niz nil?
#259
Author: Marcin Mielżyński
Date: Wed, 25 Oct 2006 17:59
13 lines
1136 bytes
Wygląda na buga samego ferreta (0.10.13) bo nie działa:

foo = Foo.find :first
index = Foo.ferret_index
query = index.process_query 'testowy'
index.hightlight query,foo.document_number

-> nil

w dodatku często sypie segfaultami...

lopex
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads