Displaying 20 results from an estimated 1000 matches similar to: "Sorting Boolean fields"
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 Aug 07
10
RideMe 1.0 (Rails IDE for Windows) 1.0
Just wanted to let all those Windows devs out there know that RideMe 1.0
dropped over the weekend.
http://www.projectrideme.com/
If you''ve never used RideMe before, here are some highlights:
* 100% free, open source, and not built on top of anything else. You
just need Ruby 1.8.2 and .NET 2.0 installed.
* Mission in life is to be lightweight and very fast. This is not a
general
2006 Sep 11
2
Compilation Errors
Hey there,
I just updated to ferret 10.0.4, and acts_as_ferret 0.3, and now when I
try to run my app with mongrel on Windows, I get very strange compile
errors:
ompile error
C:/rails/app/script/../config/../app/views/login/index.rhtml:8: Invalid
char `\002'' in expression
C:/rails/app/script/../config/../app/views/login/index.rhtml:9: syntax
error
_erbout.concat "
2006 Aug 23
8
acts_as_ferret with Mongrel and Edge Rails
Hi there,
Has anyone tried acts_as_ferret with Edge Rails and Mongrel? When I
install the plugin to a project that has Edge Rails frozen, and the
Mongrel gem installed, I can''t start the server. There''s no error, it
just doesn''t start.
I''ve used acts_as_ferret in the past with WEBrick, and stable Rails
releases without a hitch.
If I remove the
2006 Aug 20
1
sorting with booleans
Hi i have a column in my ferret model called sponsored. It is a boolean
and i want to order the results by sponsored and date registered. At the
moment it is not managing to sort the booleans.
I tried declaring this in my model but it seems to have had no effect.
def false.<=>(o) o ? -1 : 0 end
def true.<=>(o) !o ? 1 : 0 end
I''m using the acts_as_ferret plugin.
below
2006 Mar 01
2
Sorting the Result
The document describes
search(query, options)
sort: An array of SortFields describing how to sort the results.
I have created index with two fields: ''file'' and ''content''
When I give SortField name as ''file'' while searching, it results into
error.
The exact command given by me:
index.search_each("sleepless AND dreams", :num_docs
2006 Oct 16
10
Sorting by score
Hi I think this is a very easy question but here goes:
I want to sort my results by a boolean field and then by score, I
thought this would be a default configuration but apparently not.
sort_fields = []
sort_fields << Ferret::Search::SortField.new(:sponsored, :reverse =>
:true)
that is my current code, how do iu alter it so that the results are then
sorted by highest score first?
2006 Jul 12
5
Reverse sorting
I am getting strange results when I reverse sort a query. I am sorting
by date, but it doesn''t seem to be related to dates (I have tried just
integers). I also paginate the results. Items in the result set are
sometimes duplicated and the not ordered at all. When I try a
non-reverse sort I don''t see duplicates and the ordering is correct. Any
ideas what is going on? Thanks
2006 May 05
3
Sorting by score
I''m trying to sort by score but it seems like SortField::SortType::SCORE
is 0 instead of a SortType. A test case is attached. Without the C
extensions the test passes, so I guess it''s a bug in them. Should I be
using it without the extensions? Because if that''s the case I have some
other bugs to report.
Greetings,
Pedro C?rte-Real
-------------- next part
2006 Aug 19
3
Activerecord validation problems
Hi everyone,
I''m having trouble validating a model. The corresponding table has some
boolean columns:
create_table :permissions do |t|
t.column :project_id, :integer, :null => false
t.column :group_id, :integer, :null => false
t.column :read, :boolean, :null => false, :default => false
t.column :write, :boolean, :null => false, :default =>
2006 Aug 30
7
AAF Sorting by date - what am I doing wrong?
I''m trying to sort my search results by Date, in descending order. I''ve
done quite a bit of reading through the forums here, and I''ve tried two
different suggestions.
This just returns results in the same order as a search without a sort:
sort_fields = []
sort_fields <<
Ferret::Search::SortField.new("ferret_created_at",:reverse => :true)
2006 Jun 07
5
RIDE-ME
I know these forums are typically for questions and such, but I thought
some of you may be interested in this...
For the past couple months I''ve been working on a Windows based IDE for
Rails development in my spare time. It closely resembles Visual Studio
in many respects, so if you''re a former ASP .NET developer like me,
you''ll feel right at home.
RIDE-ME is still
2007 Jul 13
8
More sorting problems with untokenized index
I''m having problems sorting on untokenized fields. I have one field that
sorts fine, but there are others that seem to sort on a different field.
Here''s the index description:
acts_as_ferret
:remote=>true,:fields=>{:name=>{:boost=>2},:name_for_sort=>{:index =>
:untokenized},
:city=>{:boost=>2}, :city_for_sort=>{:index=>:untokenized},
2007 Mar 31
3
Sorting issues, can anyone help me?
I have this model:
class Post < ActiveRecord::Base
acts_as_ferret :fields => { :title => {:boost => 2},
:description => {},
:url => {},
:rank_sort => {:index =>
:untokenized_omit_norms, :term_vector => :no},
2002 Mar 04
4
script to rysnc to spare hard drive
Im brand new to rsync and i been doing alot of reading about it and it looks like the tool I have long been wanting.
Bascially i got 1 server, 2 hard drives. partions are
/
/boot
/home
/usr
/var
/backup (2nd drive)
Bascially what i am looking at doing is mirroring the first drive to the 2nd drive, and once that intial one is moved over, have a
cron run nightly (or when specified) that will
2013 Nov 14
6
validates :boolean_field, presence: true misconceptions
Last night a friend of mine started ranting about validates_presence_of
:boolean_field returning not valid when the boolean field is false.
I checked the rails issues and this seems to be a pretty common concern
about the naming of ''presence'' .
Instead of changing the behaviour of the presence validator, I was
wondering if maybe the answer to avoid such misconceptions could be
2006 Aug 30
7
Hyphens
Hi there,
I''m working with some legacy data where customer phone numbers are
stored with hyphens between the area code, exchange, and number (e.g.
555-555-5555). Is this the best way to store a phone number? Perhaps
not, but it''s the way they were being stored, so I have to work with
this format.
Right, so when I save a record the log tells me acts_as_ferret indexed
the
2008 Jun 13
2
subsetting data-frame by vector of characters
Hi,
I have a very simple problem but I can't think how to solve it without
using a for loop and creating a large logical vector. However given the
nature of the problem I am sure there is a "1-liner" that could do the
same thing much more efficiently.
bascially I have a dataframe with characters in, eg
>names.and.numbers
(index) Name Fave.Number
1 John 7
2
2005 Dec 16
5
Ordering results by something other than relevance
Along with the contents of the documents in my index, I have stored
the date they were added. I want to search for keywords in the index
but have the results be sorted by their date rather than their
relevance to the keywords. How would I do this in ferret?
Thanks,
Carl
2008 Mar 01
3
Possible bug when creating a Ferret::Search::Sort object?
I may have run across a bug in Ferret: if throws a segmentation fault
when I try to create a Sort object using the default fields (SCORE and
DOC_ID), but setting reverse to true.
Here''s the minimal example:
#!/usr/bin/env ruby
require ''rubygems''
require ''ferret''
Ferret::Search::Sort.new
Ferret::Search::Sort.new(
[