Problems using acts_as_ferret

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

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?

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.

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
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

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 :stuck_out_tongue:

Have 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
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

Hi!

On Sat, Jan 13, 2007 at 02:31:19PM -0500, William Flanagan wrote:

=> #<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 [email protected]
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66

Jens K. 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 :stuck_out_tongue:

Best regards,