Displaying 20 results from an estimated 9000 matches similar to: "Is this the best approach?"
2006 May 26
1
multi_search will not work
I am trying to get multi_search to search across multiple models. I
have the following:
class Drug < ActiveRecord::Base
acts_as_ferret :store_class_name => true
end
class Target < ActiveRecord::Base
acts_as_ferret :store_class_name => true
end
and I am trying to query via:
@drugs = Drug.multi_search(params[:query], [Target])
But I get no results. If I go:
@drugs =
2006 Oct 13
5
multi_search error undefined method
Hi,
Im having problems using the multi_search command. I keep getting the
following error.
"undefined method `<<'' for Book:Class"
here is the code associated with this.
class Book < ActiveRecord::Base
acts_as_ferret :store_class_name => true
end
class User < ActiveRecord::Base
acts_as_ferret :store_class_name => true
end
and the call is the
2007 Apr 05
2
best way to maintain dynamic fields?
I have a Topic that has_many comments. In the search results only want
Topics to show up, but I want them to include the text of the comments
that they have when they are indexed. To do this I''ve added a
:comments_text field for acts_as_ferret and the comments_text method
gathers the text from all comments up into a string that can be indexed.
The trick is that when comments are added,
2006 Apr 19
1
Flash, Rails, and Routes
Hi all,
I''m working on a Flash app that loads information from Rails, using
Flash''s Loadvars() method. This is working great, in all browsers but
Win/IE. I''m wondering if it has to do with some directory/security
sandbox bug in IE''s handling of Flash, coupled with Rail''s routing.
Below are some examples. Keep in mind that the .swf file is in the
2006 May 14
4
searching on foreing keys
Hey all,
I''m using a simple search function. It''s working
great except for foreign keys.
I have one table pets (id,name,owner_id)
and another table people(id,name)
owner_id being a foreign key of pet pointing to people name.
here it is on the pet controller:
@paginator, @pets= paginate(:pets, :conditions =>["name OR owner_id
like
2007 Aug 18
0
Problem with multi-search
Hi all,
I have indexes on 2 models
e.g Message model
acts_as_ferret(:store_class_name => true,
:fields =>{:message => {:store => :compressed},
:felix_user_id => {:index
=>:untokenized_omit_norms,:store => :no})
and the chat model acts_as_ferret(:store_class_name => true,
:fields => {:name => {:store =>
2007 Mar 27
1
multi_search problems
Hello.
I''ve been trying to get multi_search to work and I simply can''t.
I have two models:
Post
acts_as_ferret :fields => [:title, :body], :store_class_name => true
Page
acts_as_ferret :fields => [:title, :body], :store_class_name => true
If I do @results = Post.find_by_contents(params[:q]) or @results =
Page.find_by_contents(params[:q]) it works fine, but if I
2007 Mar 21
2
store_class_name for Comatose:Page model
Hi,
I have three models: Comatose::Page, Article and Product.
In all of them, store_class_name is set to true.
Now, when i do:
results = Comatose::Page.multi_search("*", [Article,Product], options)
I get:
wrong constant name Comatose::Page
#{RAILS_ROOT}/vendor/plugins/acts_as_ferret/lib/class_methods.rb:438:in
`const_get''
2006 Mar 22
1
How do you clean up this cryptic code?
So, I''m coding my school project in Rails.
There are two models, User and Restaurants.
I noticed that in Restaurants, when you use the belongs_to method, you
could specify the condition of the associated table. There are a few
types of users, in the user_type column of the users table - owners is
type 1, users are type 2.
So in my haste to hand in enough code, in the Restaurant model,
2008 Jul 08
4
Conditional "link_to" helper function - AYUDAME POR FAVOR
Hello,
I need to write a function that will return a link only if the current
user is the owner. Here is my code...
1. application_helper.rb
2.
3. def link_to_if_owned(owner_id, anchor_text, where_to_go)
4. if current_user.id == owner_id # current user is owner
5. "#{link_to anchor_text, where_to_go}"
6. else
7. anchor
8. end
9. end
And
2007 May 05
4
Stop words, fields, StandardAnalyzer quagmire
Hello,
I''m using: Ruby 1.8.6, Rails 1.2.3, ferret 0.11.4, acts_as_ferret from
svn stable.
I''ve had quite a day wrestling with trying to remove the use of
stopwords. The problem was that when searching for words like "no" or
"the", no results were found. I found a confusing thing behavior that
has taken me some time to figure out, and I hope sharing it
2006 Jun 29
2
Possibly same issue as ''duplicate search results'' topic?
Unfortunately I''m a newbie to ruby, rails, and acts_as_ferret. Also,
I''m working in code I mostly didn''t write, so I''m kind of unsure of
things. So this may be a dumb question. It also may be the same issue
as the topic ''Duplicate search results'', but I''m not sure.
When I update column values with
2009 Apr 09
4
Weird analyzer issue with the word ''fly''
Hi all
I''m using a_a_f in rails with a StemmingAnalyzer, in the index and in my
search. I got the idea from this topic:
http://www.ruby-forum.com/topic/80178
I''m having a problem with some search terms - i narrowed one of them
down to the inclusion of the word ''fly''. Can anyone give me any clues
at to what might be happening, or even how i can investigate?
2007 Feb 25
1
Relationships question (?)
Hello there,
Im currently taking a Senior Design Course at my college. We are
developing an online document editor prototype with Rails.
I am not well-versed in Rails. As a matter of fact, we chose it for the
project in order to learn it.
The problem we have is the following:
We have a User model (id, username, password, email) and we have a
Document model (id, name, content, owner_id). A
2005 Mar 08
1
Adding to model (newbie)
Sorry if this is a really lame question, I''m sure it''s something fairly
obvious, but I just can''t see it at the moment...
I''m trying to add something simple to the model for a project
management/todo list/thing. The DB has ''first_name'' and ''last_name'',
and I''d like to have "full_name" available.
So -
2014 Dec 12
2
Fwd: Fwd: Fwd: Fwd: Fwd: Fwd: Fwd: Fwd: 26.
Anna Crepes: Traubenzucker
+ Feldsalat spezielles Dressing (bringt selbst mit?)
-------- Weitergeleitete Nachricht --------
Betreff: Fwd: Fwd: Fwd: Fwd: Fwd: Fwd: Fwd: 26.
Datum: Thu, 11 Dec 2014 15:34:39 +0100
Von: Markus <universe at truemetal.org>
An: universe at truemetal.org
Geschenke Moritz: dunkle Schokolade.
Geschenke Anna: normale Schokolade.
-------- Weitergeleitete
2007 May 22
1
Bug in Ferret::Search::SortField::SCORE ??
i have been trying to get this to work for a while now. my controller
is
sort = [ Ferret::Search::SortField::SCORE_REV ]
@results = Record.multi_search(params[:search_terms], [ Link, Post,
Event ], {:limit => :all, :sort => sort })
and in my view i just render a conglomeration of the appropriate
partials for each model. it seems that no matter what i do, i can''t get
the
2007 Jan 17
5
[ActsAsFerret] Globalize integration
Hi,
I''ve modified the latest acts_as_ferret code (version 0.3.0) to
integrate with the Globalize (http://www.globalize-rails.org/globalize/)
plugin.
Essentially, I''ve added the ability to use a separate index per locale
(It basically adds the language code as a suffix to the index and
switches between indexes when the active locale changes).
Since this introduces an optional
2007 Apr 12
0
Does Ferret have problems with #alias_method_chain ?
Hi all,
I have this in my class:
class Party < AR::B
acts_as_ferret :store_class_name => true, :remote => true,
:fields => (self.content_columns.map(&:name) rescue []) +
%w(main_identifier)
class << self
# #count is also defined, omitted for clarity
def find_with_destroyed_scope(*args)
with_destroyed_scope do
2006 Nov 30
1
usage and benefits of single-index with AAF
The documentation states:
"single_index: set this to true to let this class use a Ferret index
that is shared by all classes having :single_index set to
true. :store_class_name is set to true implicitly, as well as
index_dir, so don?t bother setting these when using this option. the
shared index will be located in index/<RAILS_ENV>/shared ."
[1] If I''m reading