similar to: Sorting performance

Displaying 20 results from an estimated 8000 matches similar to: "Sorting performance"

2006 Aug 01
8
Problem importing lots of records
I run a script that imports a few thousand records into the database. The script runs once for each of several XML files. What it does is parse the XML and for each element of a certain type creates a record in a rails database that gets indexed with acts_as_ferret. This worked fine before but today after a few files (70000 records) this started to happen for any file I tried:
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 Apr 21
3
Sorting Search results
I tried sorting the search results in Ferret::Index::Index#search and what I found was that the sort is applied not to the whole search but to the returned results. Suppose I have these results: Text - Num foo - 2 bar - 3 far - 4 boo - 1 If I limit the search to the first two and sort by num I get: foo - 2 bar - 3 while I think the natural behaviour would be: boo - 1 foo - 2 Is this
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 =
2006 May 26
8
Comparing two documents in the index
I want to compare two documents in the index (i.e. retrieve the cosine similarity/score between two documents term-vector''s). Is this possible using the standard Ferret functionality? Thanks in advance, Jeroen Bulters -- Posted via http://www.ruby-forum.com/.
2006 Sep 18
16
Dynamic fields and AAF
Hi, I have a model which has properties, these are your standard name/value pairs, but also have attributes that affect how I want to store them in ferret. I was using 0.9.5 with 0.2 of aaf, which seemed fine, I just copied and pasted (yes, I know, ick) the to_doc method and added code to iterate though the properties that that model had, and add relavent fields to the document. It seems
2006 Apr 20
1
Creating my own analyzer
I created this analyzer: class DescriptionAnalyzer < Ferret::Analysis::Analyzer def token_stream(field, string) if field == "code" return CodeTokenStream.new(string) else return Ferret::Analysis::Analyzer.new.token_stream(field,string) end end end and created an IndexWriter with it: Ferret::Index::IndexWriter.new(get_index_path,
2006 Aug 18
1
Portuguese Stemming
Today while compiling ferret I noticed there was a Portuguese stemmer being compiled. How do I enable it''s use for my index? Pedro.
2006 May 09
1
Reverse sorts by score
The docs for Sort.new say: reverse: pass true if you want the sort order to be reversed. Only works if you pass the field names. Does this mean it''s not possible to do a reverse sort by score? If it is it seems to be broken as I don''t seem to be able to reverse the order of the sort. I''ll write a test case if this is not a known problem. Greetings, Pedro.
2006 Aug 25
7
disabling automatic indexing in acts_as_ferret
I''d like to be able to enable/disable the automatic indexing of documents acts_as_ferret does. Something like MyModel.disable_indexing MyModel.enable_indexing would be perfect. I need this because I do some indexing that requires visiting the parents of the model objects and my import method imports the children first, so the information isn''t there yet. I''d like to
2005 Dec 02
43
ANN: acts_as_ferret
Hi all This week I have worked with Rails and Ferret to test Ferrets (and Lucenes) capabilities. I decided to make a mixin for ActiveRecord as it seemed the simplest possible solution and I ended up making this into a plugin. For more info on Ferret see: http://ferret.davebalmain.com/trac/ The plugin is functional but could easily be refined. Anyway I want to share it with you. Regard it as a
2005 Dec 02
43
ANN: acts_as_ferret
Hi all This week I have worked with Rails and Ferret to test Ferrets (and Lucenes) capabilities. I decided to make a mixin for ActiveRecord as it seemed the simplest possible solution and I ended up making this into a plugin. For more info on Ferret see: http://ferret.davebalmain.com/trac/ The plugin is functional but could easily be refined. Anyway I want to share it with you. Regard it as a
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 Apr 27
1
Ferret crashing Ruby
I''ve gotten several problems with C ferret crashing ruby. Here''s the stack trace of my latest case: #0 0x00000050 in ?? () #1 0xb74028ab in iw_close (iw=0x8685a40) at index_rw.c:947 #2 0xb7414359 in index_destroy (self=0x829ebc0) at ind.c:89 #3 0xb73f00bc in frt_ind_free (p=0x829ebc0) at r_search.c:1564 #4 0xb7f04dca in rb_gc_call_finalizer_at_exit () from
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
2006 Nov 01
8
aaf and stop words; query parser
I''ve been trying to implement acts_as_ferret in my latest project and ran into a snag. If I do a search for ''auditor state'' then the search works perfectly. If I include a stop word, as in ''auditor of state'', then I get no results. I''d prefer not to set stop words to nil and index everything. The solution, that I have yet to attempt, is to use
2006 Jul 05
10
Scalable alternative to #find_all
Is there any scalable alternative to iterating all the records of a certain model? #find_all seems to load everything into memory. With 500.000 records it will be a swap storm. Pedro.
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 Oct 02
4
Another web app using Ferret
I am apart of a team that runs a student site called Studicious (http://stu.dicio.us). We have been using Ferret from the beginning, and recently added acts_as_ferret and sorting to the system. As you can see if you try the search, sorting is not working as expected. I am using this code (w/ find_by_content): :sort => Ferret::Search::SortField.new(:school_sort, :reverse => false)
2007 Jan 11
5
ASF: cannot determine document number from primary key
I''m getting this exception from acts_as_ferret: A RuntimeError occurred in search#similar: cannot determine document number from primary key: #<MyClass:0x9feba20> [RAILS_ROOT]/vendor/plugins/acts_as_ferret/lib/instance_methods.rb:132:in `document_number'' As a result of this call: object.more_like_this The relevant backtrace: