Displaying 20 results from an estimated 4000 matches similar to: "How to search with limit by field"
2011 Nov 29
2
aggregate syntax for grouped column means
I am calculating the mean of each column grouped by the variable 'id'.
I do this using aggregate, data.table, and plyr. My aggregate results
do not match the other two, and I am trying to figure out what is
incorrect with my syntax. Any suggestions? Thanks.
Here is the data.
myData <- structure(list(var1 = c(31.59, 32.21, 31.78, 31.34, 31.61, 31.61,
30.59, 30.84, 30.98, 30.79, 30.79,
2006 Jul 19
4
sorting and pagination
Hello All,
Okay i think I''m finally getting all of what i want out of ferret
working, thanks mostly to reading this forum and also getting ALOT of
questions answered, thanks alot everyone. Anyway my last ferret task is
too get the results sorted by a field called date_registered and have
this working with pagination.
here is what i''m doing at the moment:
2007 May 14
2
creating a "list of 3 dataframes" from a "list of 2 dataframes" and a dataframe?
#I wish to create a "list of three dataframes" ("results2") from a "list of two dataframes" (temp) and a dataframe ("c")?
#Please advise.
a <- data.frame(x=c(1,2,3),y=c(5,7,9))
b <- data.frame(x=c(2,4,7,9),y=c(2,3,5,4))
c <- data.frame(x=c(22,34,7,9),y=c(52,63,5,4))
results1 <- list(a,b,c) #what I want
#but this is how I need to get there
2012 Feb 08
1
How indices calculated in package "boot"
Hi,there,
I am using R package "boot" to bootstrap. I have one question here: does
anybody possibly know how the boot package generates the "indices" which is
used in the statistic function?
I thought "indices = sample(data, replace=TRUE)", but when I replaced
"indices" with this command and used "boot", I got different results.
Specifically,
2009 Jul 28
3
Help with significance. T-test?
Hi,
this is more a general statistics question I think.
I am working on a system which automatically answers user questions (such
systems are commonly called "Question Answering systems").
I evaluated different versions of the same system on a publicly available
test set.
This set contains 500 question. Naturally, for each question the answer can
be wrong or right, which is coded as
2007 May 30
4
aaf and dynamic attrs: a bug?
Hi!
I faced some issue while using it for dynamic attrs indexing/search.
Maybe I made something wrong. Here is test method. Everything works just
fine until last line http://pastie.caboo.se/66274 . Tested on both
stable and trunk of aaf and ferret 0.11.4.
the short version of code below:
Contact.acts_as_ferret :fields => [ :first_name ]
assert
2006 Sep 19
2
acts_as_ferret and Fuzzy Searching
Hi there,
I''d like to be able to tune the results of a Fuzzy search in a rails
application. I''ve tried setting the following in my environment.rb file.
Ferret::Search::FuzzyQuery.default_min_similarity = 0.75
Ferret::Search::FuzzyQuery.default_prefix_length = 2
When I go into the console, I can see those values as the default
but when I run a search like
2009 Oct 26
2
find_with_ferret issue
Hi All,
I''m implementing the ferret search engine on my railspace project.
In my User and Info model, I have line that reads:
acts_as_ferret :fields => [''username'', ''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
2006 Aug 25
4
using conditions
Hello guys,
I''m pretty new to using AAF and am having a slight problem with using a
condition. I have the following code
@results = SupplierProduct.find_by_contents(params[:search], :conditions
=> [''area_id = ?'', @area])
and it seems the condition isn''t being applied. Does anyone have any
pointers?
Cheers,
Alastair
--
Posted via
2006 Nov 02
2
highlighting with find_by_contents
I''m trying to highlight keyword snippets using the highlight method of
the results returned from find_by_contents (the actual models), but
always come up with an empty array. Any ideas what could be going wrong?
--
Posted via http://www.ruby-forum.com/.
2007 Jun 25
1
hello, is there a way to exclude duplicates of a field?
hi,
this is what i am trying to accomplish
Post.find_by_contents("artist:#{session[:srchstring]}*")
this returns to me all artist with the first letter of say ''n'' is there
a way to not repeat valuse of the same artist?
thank you so much for the help./
--
Posted via http://www.ruby-forum.com/.
2006 Aug 20
7
missing terms in index causing search errors
I am unable to find results for models when one or more of the terms are
not being indexed.
Lets suppose I index a User on the phrase "Ruby on Rails." If I then
search using User.find_by_contents("Ruby on Rails") I get no results,
since "or" is a common term and does not get indexed. Of course,
User.find_by_contents("Ruby Rails") works just fine.
I
2006 Jul 10
2
acts_as_ferret 0.2.2
Hi all,
I just tagged acts_as_ferret 0.2.2 as the current stable version, so get
it while it''s hot ;-)
new features:
- added support for the multiple models/single index approach.
- find out the total number of search results by calling total_hits on
the array returned by find_by_contents.
fixes:
- trac tickets #20 (find_by_contents breaks ferret sorting) and #24
2007 Jun 15
2
indexed ''text'' (not string) column not used when searching, unless explicitely specified!!
Hi all,
I''ve included a mysql ''text'' column in my index, and aaf/Ferret
doesn''t use it when I search, UNLESS I specify it as a restrictor, and
then it only searches in that field!
For example:
=> 0 results are returned by a standard (__all__ fields ?) search
>> Entity.find_by_contents "zixi"
Query: zixi
total hits: 0, results
2006 Oct 02
6
Strange Sorting Issues
Hi there,
I''m having some strange sorting stuff goign on. Here''s my search method:
sort_fields = []
sort_fields << Ferret::Search::SortField.new("name",
:reverse => :false)
@results = Listing.find_by_contents @search_criteria, :limit => :all,
:sort => sort_fields
page = (params[:page] ||= 1).to_i
items_per_page = 9
offset = (page - 1) *
2006 Jul 09
3
acts_as_ferret.. what does it actually do?
Okay in this plea for help I''m going to repeat some of what i posted
before but with a larger amount of background info in the hope that i
can get a decent grip on ferret before it wriggles away..
Firstly, what does installing the acts_as_ferret plugin actually do? I
install it and add it to my model and then the index is automatically
generated and a few methods are added to it and
2006 Aug 25
7
acts_as_ferret with conditions
Hello guys,
Having a slight problem with acts_as_ferret, specifically using a
condition. I have the following code
@results = SupplierProduct.find_by_contents(params
[:search], :conditions => [''area_id = ?'', @area])
and it seems the condition isn''t being applied. Does anyone have any
pointers?
Cheers,
Alastair
------
Alastair Moore
Standards compliant web
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/.
2006 May 31
5
Help with sorting arrays with objects in it
I have to build an array through both activerecord and also through a ferret
index.
I was hoping to find a way of sorting the array as i combine the two so
def advanced_search(search_text, store, format, sortby)
# find items in ferret index
items = Item.find_by_contents(search_text)
# and now find all the items from a certain store or category
items_from_sql = Item.find_by_sql("SELECT *
2006 Nov 27
2
find_conditions in acts_as_ferret find_by_contents
Hi all,
Every time I try to add options for the find_conditions argument of
find_by_contents I get the following:
a = AnnotatedLink.find_by_contents(''test'', {}, {:conditions =>
''category_id IS NOT NULL''})
>> NoMethodError: You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occured while