Hi all, I''m trying to use acts_as_ferret and have run into a brick wall. My model is Page My controller is Pages_controller. When in console, I can search for contents, and find results. For example, when I search for "spam" it "finds" 7 results. => #<FerretMixin::Acts::ARFerret::SearchResults:0x2693934 @total_hits=7, @results=[]> you can do a "p.total_hits" and get 7.. but the results are empty. If i iterate over the p in this i get no entries. How do I get to the entries that it found for the search? Am I doing something wrong? Thanks, William
Hi! On Sat, Jan 13, 2007 at 02:31:19PM -0500, William Flanagan wrote:> Hi all, > > I''m trying to use acts_as_ferret and have run into a brick wall. > > My model is Page > My controller is Pages_controller. > > When in console, I can search for contents, and find results. For > example, when I search for "spam" it "finds" 7 results. > > => #<FerretMixin::Acts::ARFerret::SearchResults:0x2693934 > @total_hits=7, @results=[]> > > you can do a "p.total_hits" and get 7.. but the results are empty. If > i iterate over the p in this i get no entries. > > How do I get to the entries that it found for the search? Am I doing > something wrong?Looks like Ferret got 7 hits from it''s index, but acts_as_ferret could not find them in your db. could you please look into development.log for some relevant output when doing this search on the console ? Jens -- webit! Gesellschaft f?r neue Medien mbH www.webit.de Dipl.-Wirtschaftsingenieur Jens Kr?mer kraemer at webit.de Schnorrstra?e 76 Tel +49 351 46766 0 D-01069 Dresden Fax +49 351 46766 66
William Flanagan wrote:> > When in console, I can search for contents, and find results. For > example, when I search for "spam" it "finds" 7 results. > > => #<FerretMixin::Acts::ARFerret::SearchResults:0x2693934 > @total_hits=7, @results=[]> >I got the similar problem here:>> SearchController.new.full_text_search("*","products",:page => 1)#<FerretMixin::Acts::ARFerret::SearchResults:0x46553d4 @total_hits=7, @results=[]> => [7, #<FerretMixin::Acts::ARFerret::SearchResults:0x46553d4 @total_hits=7, @results=[]>]>>Any ideas how to debug it? Why it is returning 7 here too? -- Posted via http://www.ruby-forum.com/.
On Wed, Feb 28, 2007 at 04:40:26PM +0100, Linus wrote:> William Flanagan wrote: > > > > When in console, I can search for contents, and find results. For > > example, when I search for "spam" it "finds" 7 results. > > > > => #<FerretMixin::Acts::ARFerret::SearchResults:0x2693934 > > @total_hits=7, @results=[]> > > > I got the similar problem here: > >> SearchController.new.full_text_search("*","products",:page => 1) > #<FerretMixin::Acts::ARFerret::SearchResults:0x46553d4 @total_hits=7, > @results=[]> > => [7, #<FerretMixin::Acts::ARFerret::SearchResults:0x46553d4 > @total_hits=7, @results=[]>] > >> > > Any ideas how to debug it? Why it is returning 7 here too?for some reason aaf doesn''t get any records from your db. have a look into your log files, there you should see the sql aaf issues to retrieve the records. Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa
Jens Kraemer wrote:> On Wed, Feb 28, 2007 at 04:40:26PM +0100, Linus wrote: >> #<FerretMixin::Acts::ARFerret::SearchResults:0x46553d4 @total_hits=7, >> @results=[]> >> => [7, #<FerretMixin::Acts::ARFerret::SearchResults:0x46553d4 >> @total_hits=7, @results=[]>] >> >> >> >> Any ideas how to debug it? Why it is returning 7 here too? > > for some reason aaf doesn''t get any records from your db. have a look > into your log files, there you should see the sql aaf issues to retrieve > the records. >I started to work... I did not spot the hang processes that were indexing my 6000 records. I killed them, removed the index/ dir, waited for the query to complite and now it works. Need to find out how to generate the index on data export, not form web app :P Best regards, -- Posted via http://www.ruby-forum.com/.
On Wed, Feb 28, 2007 at 05:17:02PM +0100, Linus wrote: [..]> > Need to find out how to generate the index on data export, not form web > app :PHave a look at backgroundrb - it''s great for such long running tasks. cheers, Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa