search for: find_with_ferret

Displaying 11 results from an estimated 11 matches for "find_with_ferret".

2007 Dec 13
4
please explain find_with_ferret, retrieve_records, :include and :conditions
Hello, I''m using find_with_ferret to search multiple models and it works great. The trouble is I need to filter the results using :include and :conditions. I get two errors depending on the syntax I use in the search. Reading the source, I see the retrieve_records method seems to filter the :include and :conditions so that...
2008 Feb 01
0
find_with_ferret and HABTM assocs
...n methods between Role and User being set up correctly? (If not, make sure your statement is "has_and_belongs_to_many", and not "hasandbelongstomany".) -- Are you storing the data for role_name in the index? If so, can you see it there? I''m not familiar with the find_with_ferret method (because I use index.search_each). However, in my code I do have a case where I do something like your role_name method, and the output gets indexed. --Paul Rolf Guescini wrote: > Hi there, I have now read a lot of pages on doing find_with_ferret with > associations, and still...
2009 Oct 26
2
find_with_ferret issue
...'email''] This initially generates a find_by_contents which is added to the community contoller: @users = User. find_by_contents(query, :limit => :all) THis returned a method error, and after some digging, it turns out that the find_by_contents is not replaced with: @users = User.find_with_ferret(query, :limit => :all) HOWEVER..... With this in place, the book says the search should work. But for some reason, I click search, and nothing is returned... Has anyone else had this issue? and why is nothing been returned in the browser?
2010 Jan 21
2
will_paginate ?
...#39;'/search'', :controller => ''notes'', :action => ''search'' notes.rb ... acts_as_ferret :fields => [ ''body'' ] notes_controller.rb ... def search if params[ :query ] @query = params[ :query ] @notes = Note.find_with_ferret @query, :page => params [ :page ], :per_page => 3 end respond_to do |format| format.html # search.html.erb format.xml { render :xml => @notes } end end notes/index.html.erb ... <% if @notes.length > 1 %> <% form_tag :action => ''search...
2007 Oct 03
3
Pagination problem with acts_as_ferret
Hi, am using this wonderful plugin acts_as_ferret and according to the tutorial at http://railsenvy.com/2007/2/19/acts-as- ? rial#basic I worked it out except the pagination feature. If I have 12 records and I give limit to 10, its correctly displaying 10 records in the first page and is giving the link to the second page too. But when I go to the next page I find the same 10 records instead of
2008 Jun 25
3
Need some suggestions on search strategy
I need some suggestions for the best way to implement search for my client. They have several models (project, request, usage, etc.) that they need to search for. Each model will have its own search page with a form that is similar to the one shown for editing. So the search needs to be across model fields and the results are limited to the model. Some of the model fields will be for
2009 Jan 05
1
acts_as_ferret ActsAsFerret::IndexNotDefined
...use acts_as_ferret at first. I have several models with acts_as_ferret. When I do search in the models User,Article,Therm it works fine. But when I try search in Addition model or in Page model I got following error message: ActsAsFerret::IndexNotDefined addition in the string: @results = Addition.find_with_ferret(params[:q]) or ActsAsFerret::IndexNotDefined page in the string: @results = Page.find_with_ferret(params[:q]) Where is mistake? Thanks! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the...
2009 Apr 25
0
ferret, will_paginate and group by
Hi, Is it possible to use "find_with_ferret" and GROUP BY together? Count(*) doesn''t return what will_paginate expects when using GROUP BY, and AFAIK a workaround for that is to manually get total_entries and pass it to Model.paginate. However how does that work with find_with_ferret where I have no idea how to find total_ent...
2008 Jan 03
0
Problem (with fix?) for passing :multi => [ ]
...is > empty. > > Following the code through method calls in the class_methods file in > acts_as_ferret, it seems that having a value for :multi but not having > any classes in it causes some confusion. > > To get around this, i added the following line at the start of the > find_with_ferret method (which is an alias for find_by_contents) - > > options.delete :multi if options[:multi] == [] > > This removes the confusion and everything''s fine as far as i can tell. > My question is this - should what i''ve done be considered a bug fix for > find_wi...
2007 Nov 09
2
Problem with stemming and AAF
...an point me in the right direction! I''ve implemented a basic search with AAF, which works as expected; I''m running a ferret drb server, and using will_paginate to page results. The code in my search_controller.rb: search_text = params[:query] || " " @products = Product.find_with_ferret(search_text, :page => params[:page], :per_page => #$ItemsPerPage, :limit => $ItemsPerPage, :offset => $offset) @results_pages = Product.paginate_search(search_text, :page => params[:page], :per_page => $ItemsPerPage) The next step was to implement stemming, which seemed straigh...
2009 Apr 09
4
Weird analyzer issue with the word ''fly''
...}}) And this analyzer is defined in a module thus: module Ferret::Analysis class StemmingAnalyzer def token_stream(field, text) StemFilter.new(StandardTokenizer.new(text)) end end end Now, here''s a search without using the analyzer: >> TeachingObject.find_with_ferret("flea fly", :per_page => 2000).size => 14 And with the analyzer: >> TeachingObject.find_with_ferret("flea fly", :per_page => 2000, :analyzer => Ferret::Analysis::StemmingAnalyzer.new).size => 0 Now, for other searches, the analyzer seems to be doing it...