Displaying 20 results from an estimated 10000 matches similar to: "is it possible to get id of the matched field?"
2007 Jun 24
6
I only want one type of model returned from a multi_search
I am trying to use acts_as_ferret''s multi_search to search across
multiple models, but i only want it to return one type of model.
for example i have a page that lists out people. on this page it shows
email addresses and phone numbers. I want to be able to search by any
fields directly from the person model and search the fields from the
email_address and phone_number models, but I only
2006 Jul 05
0
Javascript repeating fields.
The one area I keep hitting my head against in Rails is repeating fields via
javascript. I frequently have forms where one or more fields are actually
broken out into sub tables because there can be multiple simultaneous values.
Rails seems to want to you to use the [] construct in the form helpers (e.g.
text_field(''employee[]'', ''name'')), but I can''t
2007 Feb 09
1
[AAF] Determine matching field in a search result
I was wondering if it was possible to determine which field caused the
match to occur (or contributed the most to the score) in a search
result.
For example, if I had a record
{ :name => ''pumpkin'', :age => -5, :address => ''Via Mandriola'' }
and I did a search for ''Mandriola'', is it possible for acts_as_ferret to
tell me that the
2007 Aug 04
1
Can''t find using instance method as field
Hi, I just started experimenting with acts_as_ferret. It''s working great
if I''m searching through database fields through a setup like:
acts_as_ferret :fields => [''title'']
Page.find_by_contents(''Blue'')
But if I try searching through an instance method, I get no results
back. Anybody know why?
acts_as_ferret :fields =>
2007 Jan 24
2
Disable search match on model id
Hi,
Given a numerical search term I want to avoid matching the model id as
this has no real world significance when returned in the results (in
this instance).
For example the user may enter ''13'' when looking for a product code.
Presently they will also get back the product that has id 13.
I have tried:
acts_as_ferret :fields => {:id => { :index => :no },
2007 Apr 27
1
Return which field/index a result hit was found in
Hello!
This forum is an extremely valuable resource! Thanks to everyone who has
contributed, especially Jens and Dave. I hope I''ll be able to give something
back to the community soon!
I have a model, ''Book'', that has associations to several other models,
comments, tags, authors, etc.. I have implemented acts_as_ferret to search
the Book model and the associations as
2007 May 30
2
How to search with limit by field
Hello,
I have a ferret index with 2 fields:
Acts_as_ferret :fields => [:client, :content]
If I do model.find_by_contents(query) I obtain all results by the query
but I would like to obtain 3 results for each client.
Any ideas?
Thanks for all.
--
Posted via http://www.ruby-forum.com/.
2006 Oct 16
8
acts_as_ferret: can i specify a search on 1 field as suppose
to the ones i defined in my model? for example if in the model i specify
acts_as_ferret to index only column 1, 2, and 3 in my table....how can i
perform a search just for column 1 if need be.
for example, id like to give the user the ability to just search on
title name vs description, etc...
thanks!
--
Posted via http://www.ruby-forum.com/.
2006 Oct 10
3
Dynamic fields and inheritance
I have a model that allows subclasses to dynamically define fields.
The following code is a short test case that illustrates the problem I''m
having:
class Product < ActiveRecord::Base
acts_as_ferret :fields => [:name]
serialize :data
def self.data_properties (*properties)
properties.each do |property|
define_method(property) {self.get_property(property)}
2006 Sep 04
4
Fields
Sorry for asking so many questions recently.
Just wondered. I originally had acts_as_ferret in my model and I
performed a few searches. I then decided to change this line to
acts_as_ferret :fields => [ ?name? ]
However when I perform searches it is still listing results with queries
contained in fields other than the ''name'' field. How do i fix this?
--
Posted via
2008 Nov 04
3
Nester Resources, Routes and Class Inheritance
Ok here''s a quicky... but a goody :)
We have models Company, Reference and Applicant... and References and
Applicants just inherit from Company, and are basically companies with
the type field set to reference...
All companies can have a phone number associated with them, and phone
number is a different model...
I''m having trouble using the form_for method with a company that
2007 Aug 10
3
Different ferret fields for instances of the same model?
Hi all,
So far as I know, while using acts_as_ferret, we should add the
following declaration in the ActiveRecord model which is going to be
indexed:
acts_as_ferret({:fields => @@ferrect_fields})
in which @@ferrect_fields is a hash containing all the field to be
indexed. This is pretty much for some simple situations. But I got a
more complex situation that I want to define the fields to be
2006 May 18
1
multi_search problem
I am running into the following error when I try to search across
multiple models with multi_search() I have rebuilt the indices and can
search on each model individually using the Rails console.
Here is the output from the console.
>> Post.multi_search(''new'', [Message, WikiPage])
ArgumentError: wrong number of arguments (1 for 0)
from
2007 Jul 17
3
two acts_as_ferret questions!
hi, guys:
two acts_as_ferret questions!
1, ruby script/plugin install
svn://projects.jkraemer.net/acts_as_ferret/tags/stable/acts_as_ferret
sh: svn: command not found
i can not install acts_as_ferret to my Rails project.
what''s wrong? i''m useing rhel 4!
2, i downloaded the acts_as_ferret-0.4.0.tgz at
http://rubyforge.org/frs/?group_id=2916&release_id=10617
and uploaded to
2007 Jun 04
1
Ferret install on WinXP fails - procedure entry point rb_w32
Hello. I''m trying to use the ''acts_as_ferret'' gem with Rails.
Rails: 1.1.4 and 1.2.3
OS: WinXP
I''ve installed both Ferret and the plugin using Ruby Gems:
C:\>gem install ferret
Successfully installed ferret-0.11.4-mswin32
Installing ri documentation for ferret-0.11.4-mswin32...
Installing RDoc documentation for ferret-0.11.4-mswin32...
C:\>gem install
2006 Jul 20
2
search on fields
Hi,
I wonder if it is possible to perform the "find_by_contents" on a subset
of fields indexed in acts_as_ferret.If so, how?
In my code I have:
acts_as_ferret (:fields => [''title'', ''focus'', ''purpose''])
However, I like to have two search options one on all fields and one
only on the title.
Any help is most appreciated.
2006 May 10
1
acts_as_ferret choking
Hi all,
I''ve ran into a problem with Ferret on my rails app, and I don''t
really have a clue about why. When running the unit tests, I get the
following error output:
> Exception raised:
> Class: <NoMethodError>
> Message: <"You have a nil object when you didn''t expect it!\nThe
> error occured while evaluating nil.version">
>
2007 Apr 18
1
stack level too deep for method missing when using drb
I set up ferret and it''s running fine normally. Now I want to hook up
the backgroundrb server. However whenever I try to do a search, I get
this error:
(druby://localhost:9010) /usr/local/lib/ruby/1.8/drb/drb.rb:1075:in
`method_missing''
(druby://localhost:9010)
./vendor/plugins/acts_as_ferret/lib/remote_index.rb:20:in
`find_id_by_contents''
(druby://localhost:9010)
2007 Jul 04
2
problems after gem update
Hi, I had ferret working wonderfully but i am regretting doing a gem
update today.
I had alot of trouble first installing it and was really happy to have
it working. The upgrade was from 0.3.1 to 0.4.0.
The problem is;
in the rails console,
>> @results = Book.find_by_contents("peter pan")
=> #<ActsAsFerret::SearchResults:0x487040c @total_hits=0, @results=[]>
Its indexing
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