search for: ferretmixin

Displaying 14 results from an estimated 14 matches for "ferretmixin".

2007 Jan 13
5
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? Than...
2005 Dec 02
43
ANN: acts_as_ferret
...ferret/lib/acts_as_ferret.rb The Ferret DB is stored in: {RAILS_ROOT}/db/index.db Here follows the code: # CODE for init.rb require ''acts_as_ferret'' # END init.rb # CODE for acts_as_ferret.rb require ''active_record'' require ''ferret'' module FerretMixin #(was: Foo) module Acts #:nodoc: module ARFerret #:nodoc: def self.append_features(base) super base.extend(MacroMethods) end # declare the class level helper methods # which will load the relevant instance methods defi...
2005 Dec 02
43
ANN: acts_as_ferret
...ferret/lib/acts_as_ferret.rb The Ferret DB is stored in: {RAILS_ROOT}/db/index.db Here follows the code: # CODE for init.rb require ''acts_as_ferret'' # END init.rb # CODE for acts_as_ferret.rb require ''active_record'' require ''ferret'' module FerretMixin #(was: Foo) module Acts #:nodoc: module ARFerret #:nodoc: def self.append_features(base) super base.extend(MacroMethods) end # declare the class level helper methods # which will load the relevant instance methods defi...
2006 Aug 14
1
respond_to? in acts_as_ferret results
acts_as_ferret''s search results use #method_missing to forward method calls to the underlying result object. However, those methods are represented in #respond_to? Here''s a simple fix for that: module FerretMixin module Acts module ARFerret class SearchResults def respond_to?(name) self.methods.include?(name) || @results.respond_to?(name) end end end end end thanks -ryan
2006 Oct 21
2
find_by_content result set
Hi Guys I''m experiencing with AAF and Ferret with the intention of deploying into the site that I am working on now. So I setup AAF to index 3 fields that I have in this model and i tried doing a find_by_contents and it returned the #<FerretMixin::Acts::ARFerret::SearchResults:0xb74b5bec @total_hits=1157, @results=[#<Payprofile:0xb74cc39c @attributes={"add...... but it seems that there is no way to access the result set... I read somewhere that it''s not implement yet.. So any knows when the release will be. and until t...
2006 Jul 19
4
Ferret Indexing
Does ferret only index, when you create, or udpate a record? Is there a way to make it index prexisting records? Thanks. -- Posted via http://www.ruby-forum.com/.
2006 Nov 16
1
Strange indexing issues with CachedModel, STI, and AAF
...roduction mode. This is on a FreeBSD 6.1 server, with memcached-1.1.12_3, mysql 5.0.26, and rails 1.1.6. Any help would be appreciated as I''ve been at this one for 2 days. Here''s example output I get from irb: >> Record.find_by_contents("search code") => #<FerretMixin::Acts::ARFerret::SearchResults:0x8d9f6e0 @total_hits=212, @reults=[]> This makes me think it has something to do with the ''find'' method being overridden by CachedModel but not sure how to verify that at this point. Thanks, Curtis
2006 Oct 10
3
Dynamic fields and inheritance
...true >> (Music.new(:name => ''Abbey Road'', :artist => ''The Beatles'', :label => ''Apple'')).save => true But things start to get strange when I search for content: >> Book.find_by_contents(''*'') => #<FerretMixin::Acts::ARFerret::SearchResults:0xb7433ef8 @total_hits=2, @results=[]> >> Music.find_by_contents(''*'') => #<FerretMixin::Acts::ARFerret::SearchResults:0xb7431360 @total_hits=2, @results=[#<Music:0xb7431608 @attributes={"name"=>"Abbey Road"...
2006 May 22
7
how to index the result of any instance method
Hi, One of the AAF features is to be able to index results of methods, but I haven''t seen anywhere how to do this. I have a method that returns the full text of a file and I''d like for this to be indexed. Can anyone out there help me out on this one? Tom -- Posted via http://www.ruby-forum.com/.
2006 Jun 29
13
find_by_contents not returning SearchResults?
The acts_as_ferret documentation says find_by_content returns an instance of SearchResults, but I see this error when I try to use the results. undefined method `total_hits'' for []:Array Here is the link to the documentation: http://projects.jkraemer.net/acts_as_ferret/rdoc/classes/FerretMixin/Acts/ARFerret/ClassMethods.html#M000010 But here is the actual code: result = [] hits = index_searcher.search(query, options) hits.each do |hit, score| id = index_searcher.reader.get_document(hit)[:id] begin res = sel...
2006 Dec 31
1
How do you use acts_as_ferret without rails?
I am currently using activerecord without rails and I''d like to use the acts_as_ferret plugin as it works well with activerecord. How do I take advantage of the acts_as_ferret without rails installed? Is this possible? If someone could provide me with direction on how this would be done, that would be greatly appreciated. I assume that since active record works without rails that all
2006 Oct 09
1
acts_as_ferret: case insensitive search
How can I index and search RoR model objects in a case insensitive manner? In Ferret there is the LowerCaseFilter (http://ferret.davebalmain.com/api/classes/Ferret/Analysis/LowerCaseFilter.html). How can I utilize it and other filters with acts_as_ferret? -- Posted via http://www.ruby-forum.com/.
2006 Jun 25
1
acts_as_ferret with existing data (Building an index?)
Hi, I''m trying to get the acts_as_ferret plugin to work with my rails application, but it barfs with this error: No such file or directory - ./index/development/Book/segments I have existing data in my database, but it was added prior to me using the ferret plugin. How do I get it to index that data, or when does it index that data? Charlie -- Posted via
2006 Nov 06
21
acts_as_ferret and associations
I have the following models: class Book < ActiveRecord::Base acts_as_ferret belongs_to :author end class Author < ActiveRecord::Base has_many :books end and in the controller: def search if params[:query] @query = params[:query] @total, @books = Book.full_text_search(@query, :page => (params[:page]||1)) @pages =