Displaying 20 results from an estimated 1100 matches similar to: "Wrong total_hits when using conditions in find_by_contents"
2007 Jul 18
5
Strange search result with conditions in find_by_contents
Hi, guys:
Strange search result with conditions in find_by_contents!
first of all, i''ve installed the acts_as_ferret to my project vender
folder by ''ruby script/plugin install
svn://projects.jkraemer.net/acts_as_ferret/tags/stable/acts_as_ferret''
in my SearchController
def searchforum
if !params[:doSearch].nil?
if params[:searchTerms].nil? || params[:searchTerms] ==
2007 Jan 15
3
Wrong total_hits when using conditions in find_by_contents
I don''t know if this is a bug, or wanted behavior, but for me it was a
pain in... So here''s the problem + a bugfix.
Lets say you have a model "Article" with the following fields: title,
visible - and these records
[code]title, visible
ferret talk, 1
ruby talk, 0
ruby on rails, 1
lets talk about ruby, 1[/code]
If I let Article act as a ferret, and do:
result =
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
2006 May 01
12
pagination in acts_as_ferret
I''m just wondering where I would put the pagination for search results
when using "acts_as_ferret".
At the moment my search code is..
def search
@query = params[:query] || ''''
unless @query.blank?
@results = Tutorial.find_by_contents @query
end
end
Cheers
SchmakO
--
Posted via http://www.ruby-forum.com/.
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
2007 Feb 04
10
[AAF] remote indexing via DRb with acts_as_ferret
Hi!
Aaf trunk has undergone several major refactorings the last days, with
the result that you can now transparently switch your app from local
to remote indexing and back :-)
If you plan to scale your app to more than one physical machine, or
if you have problems with corrupted indexes and the like under high
load, you really should give this a try.
I wrote some documentation to get you
2006 Aug 17
1
find_by_contents fails with :include option
find_by_contents will fail if you specify :include in the find_options
parameter. The problem is on line 313:
313: conditions = [ "id in (?)", id_array ]
314: # combine our conditions with those given by user, if any
315: if find_options[:conditions]
316: cust_opts = find_options[:conditions].dup
317: conditions.first << " and " << cust_opts.shift
318:
2006 Dec 28
13
Sorting/Ordering Search Results
Hello All,
I am having an issue with AAF and sorting results of a search. Right
now, I have results being split onto pages of 10. The results are being
sorted alphabetically, but not across multiple pages - it''s just sorting
the 10 it pulls down on each page. I noticed another post from April
regarding this same issue (http://www.ruby-forum.com/topic/62993#66934)
where the issue was
2006 Nov 20
22
Index only partially built
I have an application which I''m running using Mongrel and Apache as
described here http://www.napcs.com/howto/rails/deploy/.
I have a model Person which I am attempting to use acts_as_ferret with.
When I first try to do a search the index begins to get built but it its
fails halfway through with the following error in the browser:
===
Proxy Error
The proxy server received an invalid
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
2012 Feb 22
4
Week number from a date
Hi
My data looks like this
startDate="2008-06-01"
dateRange =c( "2008-10-01","2008-12-01")
Is there any method to find the week number from the startDate range
-----
Thanks in Advance
Arun
--
View this message in context: http://r.789695.n4.nabble.com/Week-number-from-a-date-tp4410223p4410223.html
Sent from the R help mailing list archive at Nabble.com.
2007 Aug 23
3
AAF: find_by_contents on AR Association Total Hits
I seem to be getting some behaviour thats unexpected (for me anyway)
when using find_by_contents on an ActiveRecord has_many association. The
results that are returned are only the records that belong to the model
returned, but the total_hits that are being returned appear to be for
the whole table.
e.g.
class Book < AR::Base
has_many :pages
end
class Page < AR::Base
belongs_to :book
2007 Sep 05
1
AAF and DRb with highlighting
How would I change this method in order to get highlighting working with
DRb? I''ve given up on searching on Google, I''m getting no results that
are actually helpful.
def self.find_storage_by_contents(query, options = {})
# Get the index that acts_as_ferret created for us
index = self.aaf_index.ferret_index
results = []
default_options = {:limit => 10,
2007 May 16
7
return ONLY total_hits without querying from real database
Hey guys,
I know I can run search(q).total_hits, but if I try to put :limit=>0 it
gives me an error. I don''t want it actually query any of the results, I
just want it to tell me how many total_hits I would have if I wanted to
search it.
How can I do this?
--
Posted via http://www.ruby-forum.com/.
2007 Jan 09
9
Date Approximation in Specs
The floating-point expectations allow for an error tolerance. Is
there any similar facility for dates? For example, say I have a
custom class that handles date/time spans and I want to spec it:
context "A DateRange span" do
specify "should know when a week ago is :)" do
d = DateRange.new
d.last_week.should_be_close_to(1.week.ago, 24*60*60)
end
end
The idea
2008 Jan 03
0
Problem (with fix?) for passing :multi => [ ]
Max, seems to me that your code would help to make things more robust,
if it''s a public API then it should stand up to a little abuse in ways
not intended. maybe more of an enhancement than a bug fix, but a fix
just the same.
Max Williams wrote:
> I''m using acts_as_ferret, passing through multiple classes using :multi
> and also some conditions. The way i''m
2007 Jul 03
4
problems with acts_as_ferret
Hi,
I have i am trying to add a search feature to a ruby on rails blog, so
ive decided to use ferret. So far i have had quite a few problems with
it, from following a few tutorials i didnt really understand... i am at
the point where i can make a search and it returns the score of the
result. I want it to also show the title of the post and i think i have
implemented it correctly but it
2007 Apr 13
5
undefined method `ferret_index'' for xxx:Class
Hi I am trying to use ferret; the regular search works; but when I use
the find_storage_by_contents to highlight the results, I am getting the
above error. Please help
thanks
--
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 =
2007 Apr 29
1
Chinese full-text support! Still fail-_-
Hi all,
I want to use ferrent in my website but when i input chinese words, i
have the same symptom like Chengcai. In order to fix it, i have reviewed
all the topics about chinese support in our forum and tried all the way
your guys suggested but still made any progress. i downloaded the latest
version of ferret from svn.
Thanks and regards.
captain
Chengcai He wrote:
> Hello everyone!