similar to: Help with sorting arrays with objects in it

Displaying 20 results from an estimated 400 matches similar to: "Help with sorting arrays with objects in it"

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 Jul 14
3
Whitespace Issues
I am trying to build up a filtered search using the logic below. bq = Ferret::Search::BooleanQuery.new bq.add_query(Ferret::Search::TermQuery.new(Ferret::Index::Term.new("section",section.downcase!)), Ferret::Search::BooleanClause::Occur::MUST) filter = Ferret::Search::QueryFilter.new(bq) @vobjects = VoObject.find_by_contents(search_input,:filter => filter, :sort
2006 Jan 05
2
ActiveRecord callbacks not happening
Hi, I have a model class like so: class Candidate < ActiveRecord::Base validates_presence_of :name @@index = FerretConfig::INDEX def self.after_destroy puts "Ferret: after_destroy called" @@index.query_delete("+id:#{self.id} +ferret_class:#{self.class.name}") optimize_index end end But when I delete a record, the after_destroy is never called.
2006 Aug 28
1
How should this be done with ferret 0.10.1
Hi i like the new version of ferret, has solved a few of my problems but i''m unsure of how to implement the following code in the new version of ferret? if section if !section.empty? qp = Ferret::QueryParser.new("section") query = qp.parse("\"#{section}\"") bq.add_query(query, Ferret::Search::BooleanClause::Occur::MUST) filter_on =true end
2006 Jun 27
2
Using QueryParser vs building my own query
Hello all I finally caved in and decided I should build my own query instead of relying on QueryParser to do the job for me, but I''ve hit a strange problem.. Here''s how I build my query: #Main query query = Ferret::Search::BooleanQuery.new #Build query to match types typesquery = Ferret::Search::BooleanQuery.new @selected_types.each{|type| typesquery.add_query(
2006 Aug 04
1
incorrect checksum for freed object?
I''m using ferret (0.9.4) in rails, but outside of the "acts_as_ferret" plugin. Whenever I use a QueryFilter (even a very simple one), the server will crash after one, two, or three reloads of a page (same page, same query, same filter). It''s very non-deterministic and I can''t seem to reproduce it outside of my application environment (I can''t get it
2006 Mar 29
1
Problems with Ferret 0.9.0
Hi, I upgraded from 0.3.2 to 0.9.0, and now my old search code doesn''t work anymore. I get a lot of ArgumentErrors, for example: "query.add_clause(Search::BooleanClause.new(query_parser.parse(term), Search::BooleanClause::Occur::MUST))" raises: ArgumentError (wrong number of arguments (2 for 0)) "index_searcher.search_each(query)" raises: ArgumentError
2007 Aug 23
4
scoring problem in acts_as_ferret
Hi, I am using acts_as_ferret and have a problem with scoring. I would like to organize it in such way that, if any of the searched terms fits, I get 1.0 score as a result. I will explain it on the example. I have in index: a) "one two three four" b) "one two three" c) "one two" d) "one" When I search for "one" I would like to get 1.0 score for
2004 Dec 23
1
searching Jonathan Baron's R Site
First, my site will be down December 27-28 because of a network upgrade at Penn. It will also be down at least one day before that, while I upgrade the operating system. (And another day some time in January because of a planned power outage.) Second, I have replaced the search engine in my R site: http://finzi.psych.upenn.edu/ I am now using Namazu instead of HtDig. The direct link to the
2007 Nov 09
2
Problem with stemming and AAF
I''m sure I''m missing something completely obvious here, so I hope someone can point me in the right direction! I''ve implemented a basic search with AAF, which works as expected; I''m running a ferret drb server, and using will_paginate to page results. The code in my search_controller.rb: search_text = params[:query] || " " @products =
2006 Jul 10
11
Category Number Results returned
I am looking to have a number of categories populated from my results of a search. For example, searching on "sport" would display all results for sport. I want to also have a number of categories to refine the documents down. So by clicking on the "Fishing" category or the "Shooting" category, I would only see the results on sport around that category. Now for
2005 Jan 14
1
how to produce 2-d color plots in R
Hello 'R' Users, I am very new on 'R', so excuse me if I ask something wrong. I have ASCII data and the colums of the data are looks like :- !------------------------- time,yr,mo,dy,hr,min,sec,lat,lon,ht,co2obs,sigma,co2model -- - -- !---------------------------- Each column has data value. Now I want to produce 2-d color maps, for example the plot should look like :- on
2004 Nov 24
2
an R function to search on Prof. Baron's site
Inspired by the functions that Barry Rawlingson and Dave Forrest posted for searching Rwiki and R-help archive, I've made up a function that does the search on Prof. Baron's site (Thanks to Prof. Baron's help on setting up the query string!): RSiteSearch <- function(string, restrict="Rhelp", format="long", sortby="score",
2007 Apr 06
4
Newbie having full text search problem with acts_as_ferret
Hi guys, I am using acts_as_ferret to do full text search on my models and I am having problem on three-letter word searches. I am going to use an example to explain my problem. Here it is: There is a table called users and it has login, first_name, last_name columns. There are three rows inside it. login first_name last_name bob bob henry longbob nil
2006 Jul 28
8
Building a Search Page as part of CRUD
I''ve been experimenting with Rails over the past couple of days and have come across something that seems harder than it should be. In previous frameworks I have used (WebObjects, php) a full search page (which leads into a list view populated with search results) was part of the CRUD that was either dynamically or statically created after specifying table/object schema. In
2012 Oct 12
3
CheckBox with Value and Drop down menu
I am a newbie in Ruby. I would to ask from all the experts in Ruby on how to create a checkbox with value as well as a dropdown menu. I want it like this site http://www.celiac.com/glutenfreemall/advanced_search.php. Their search form is good and I want to learn every aspect in doing it. Hope you can give me a step-by-step tutorial in doing it. Thanks in advance. -- Posted via
2007 May 14
3
How to make a Tag cloud with Ferret ?
Hello, I want to make a TAG CLOUD using ferret. How can i do so ? I would need to know the amount of keyword for every each words in the index. Thank you -- Posted via http://www.ruby-forum.com/.
2006 Sep 22
1
Query Objects vs. Query Strings
Hi .. I tried to build some query objects to get some documents from my index.. without success.. Is something wrong here? q = Ferret::Search::BooleanQuery.new q1 = Ferret::Search::TermQuery.new(:type, "movie") q2 = Ferret::Search::TermQuery.new(:name, "Indiana") q.add_query(q1, :should) q.add_query(q2, :should) Indexer.index.search_each(q) do |doc, score| puts doc end 0
2006 Jun 11
3
Bus Error with Ferret 0.9.3 using the BooleanQuery api
Hey guys, I''ve been trying out ferret 0.9.3 on my powerbook this weekend and I''ve been triggering ''bus errors'' when using the Query API. If I programmatically build up strings, it works just fine. There''s some more information available in the trac ticket http://ferret.davebalmain.com/trac/ticket/62 Is anyone successfully using the Query API on
2006 Jul 14
18
adding a custom filter to the query
Hi all, I''m trying to figure out how to add a filter into a search. I''ve created the filter, basically copying the location filter from http://blog.tourb.us/archives/ferret-and-location-based-searches. But when I try to call Index.search and pass the filter in a hash with the key :filter, I get back that it is expecting type Data, and so I''m at a loss to figure out