From david at freeswell.com Mon Oct 1 00:37:05 2007 From: david at freeswell.com (Dave Munson) Date: Mon, 1 Oct 2007 06:37:05 +0200 Subject: [Ferret-talk] Need Help with Custom Associations Message-ID: I've read the Rails Envy AAF tutorial at http://railsenvy.com/2007/2/19/acts-as-ferret-tutorial and its given me some really good ideas. My problem lies in having AAF search the target Model's child tables. I have no problem at all doing something like: acts_as_ferret :fields => [:title, :update_collection, :member_name] def member_name return "#{self.member.username}" end However when I try to query child tables like such... def update_collection self.place_updates.collect { |update| update.description }.join ' ' end I have no luck. I know the method is working because if I do something like raise Model.find(5).update_collection.inspect it returns a string with all descriptions. Any ideas? I would really appreciate any help! Dave -- Posted via http://www.ruby-forum.com/. From kraemer at webit.de Mon Oct 1 05:43:52 2007 From: kraemer at webit.de (Jens Kraemer) Date: Mon, 1 Oct 2007 11:43:52 +0200 Subject: [Ferret-talk] Need Help with Custom Associations In-Reply-To: References: Message-ID: <20071001094352.GC5085@cordoba.webit.de> On Mon, Oct 01, 2007 at 06:37:05AM +0200, Dave Munson wrote: > I've read the Rails Envy AAF tutorial at > http://railsenvy.com/2007/2/19/acts-as-ferret-tutorial and its given me > some really good ideas. > > My problem lies in having AAF search the target Model's child tables. > > I have no problem at all doing something like: > acts_as_ferret :fields => [:title, :update_collection, :member_name] > > def member_name > return "#{self.member.username}" > end > > However when I try to query child tables like such... > def update_collection > self.place_updates.collect { |update| update.description }.join > ' ' > end > I have no luck. > > I know the method is working because if I do something like > > raise Model.find(5).update_collection.inspect it returns a string with > all descriptions. > > Any ideas? I would really appreciate any help! most probably the collection isn't there yet when aaf indexes your record. Have a look at your log file to see what value aaf gets from your method when it calls it. cheers, Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa From chris at nonfatal.com Mon Oct 1 10:01:43 2007 From: chris at nonfatal.com (Chris Williams) Date: Mon, 1 Oct 2007 16:01:43 +0200 Subject: [Ferret-talk] undefined method error In-Reply-To: <20070928114750.GC29859@thunder.jkraemer.net> References: <79a3ca39133ff687819e29d2b0bfe29c@ruby-forum.com> <20070928114750.GC29859@thunder.jkraemer.net> Message-ID: Thanks for the quick response and the logging tip. >> But more importantly, since yesterday doing a search has caused an >> exception: > > since yesterday? What did you change? Having looked at this again, this problem was introduced when I upgraded the version to the trunk and switched to the drb server. >> A NoMethodError occurred in partners#user_search: >> >> undefined method `each' for :sales_region:Symbol >> [RAILS_ROOT]/vendor/plugins/acts_as_ferret/lib/class_methods.rb:246:in >> `retrieve_records' >> >> Any idea what these could have been caused by? > > not yet - I can't seem to find the line the error refers too - what > exact > revision are you on? Or could you try that with the latest trunk (rev. > 247). > > How do you use that symbol in your code? I just used the trunk, how can I find out which revision it was now? The error is caused by the following include: @results = User.find_by_contents(@query, { :limit=>5000},:conditions=>"sales_regions.firm_id in (#{firm_id_string})",:include => :sales_region) The code from aaf is here: def retrieve_records(id_arrays, find_options = {}) result = [] # get objects for each model id_arrays.each do |model, id_array| next if id_array.empty? begin model = model.constantize rescue raise "Please use ':store_class_name => true' if you want to use multi_search.\n#{$!}" end # check for include association that might only exist on some models in case of multi_search filtered_include_options = [] if include_options = find_options[:include] include_options.each do |include_option| filtered_include_options << include_option if model.reflections.has_key?(include_option.is_a?(Hash) ? include_option.keys[0].to_sym : include_option.to_sym) end end It's the include_options.each do |include_option| causing the problem. Thanks for your quick responses by the way, they are amazing. Chris. -- Posted via http://www.ruby-forum.com/. From kraemer at webit.de Mon Oct 1 10:30:40 2007 From: kraemer at webit.de (Jens Kraemer) Date: Mon, 1 Oct 2007 16:30:40 +0200 Subject: [Ferret-talk] undefined method error In-Reply-To: References: <79a3ca39133ff687819e29d2b0bfe29c@ruby-forum.com> <20070928114750.GC29859@thunder.jkraemer.net> Message-ID: <20071001143040.GD5085@cordoba.webit.de> Hi Chris, your problem seems to be a bug which has been fixed some time ago: http://projects.jkraemer.net/acts_as_ferret/ticket/160 here's the fix: http://projects.jkraemer.net/acts_as_ferret/changeset/225 On Mon, Oct 01, 2007 at 04:01:43PM +0200, Chris Williams wrote: > Thanks for the quick response and the logging tip. > > >> But more importantly, since yesterday doing a search has caused an > >> exception: > > > > since yesterday? What did you change? > Having looked at this again, this problem was introduced when I upgraded > the version to the trunk and switched to the drb server. given the fact that this bug is fixed for more than a month now, I suspect you still have an old version of the plugin somewhere... Cheers, Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa From shigeruodani at yahoo.com Mon Oct 1 10:31:22 2007 From: shigeruodani at yahoo.com (Eggman Eggman) Date: Mon, 1 Oct 2007 16:31:22 +0200 Subject: [Ferret-talk] Problem getting "extract" from RDig In-Reply-To: <507ee400cea35b644322868b36f74460@ruby-forum.com> References: <507ee400cea35b644322868b36f74460@ruby-forum.com> Message-ID: <61a9516d719f4ef9a70273c4b8246f96@ruby-forum.com> If you're creating an index from a database, wouldn't you use AAF? As far as I know, RDig is for indexing external pages. If you still want to try to get RDig to work, try crawling an external URI. If that doesn't work, try it from the command line. -- Posted via http://www.ruby-forum.com/. From kraemer at webit.de Mon Oct 1 10:53:05 2007 From: kraemer at webit.de (Jens Kraemer) Date: Mon, 1 Oct 2007 16:53:05 +0200 Subject: [Ferret-talk] Remote index blocks? In-Reply-To: <1F2A1124-D572-4A08-A7C5-D4917DECC343@gmail.com> References: <944D54BF-8203-4E4E-AA52-4D3803B2562D@gmail.com> <20070927202950.GB17667@cordoba.webit.de> <50D7FFF7-22E5-46A0-A824-B0941BB97806@gmail.com> <20070929161218.GG29859@thunder.jkraemer.net> <1F2A1124-D572-4A08-A7C5-D4917DECC343@gmail.com> Message-ID: <20071001145305.GE5085@cordoba.webit.de> On Sat, Sep 29, 2007 at 12:27:50PM -0400, Erik Morton wrote: > We are going to hack AAF a bit to make the optimize optional. Should > we flush every time we bulk index if we don't optimize? yes, I'd do so. It will be done when the index class closes the underlying writer, anyway. I just made bulk_index a bit more configurable, you may now pass :optimize => false to skip the optimization step. > I'm running this application on EC2, so I think part of the problem > is the poor IO performance on the VPS. Yes, I guess poor IO performance and optimizing a 3GB index aren't an optimal combination :-) cheers, Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa From chris at nonfatal.com Mon Oct 1 11:07:27 2007 From: chris at nonfatal.com (Chris Williams) Date: Mon, 1 Oct 2007 17:07:27 +0200 Subject: [Ferret-talk] undefined method error In-Reply-To: <20071001143040.GD5085@cordoba.webit.de> References: <79a3ca39133ff687819e29d2b0bfe29c@ruby-forum.com> <20070928114750.GC29859@thunder.jkraemer.net> <20071001143040.GD5085@cordoba.webit.de> Message-ID: Upgrading fixed it. Thanks again. Chris. -- Posted via http://www.ruby-forum.com/. From vinay.khater at gmail.com Mon Oct 1 13:21:25 2007 From: vinay.khater at gmail.com (jazzy jazzy) Date: Mon, 1 Oct 2007 19:21:25 +0200 Subject: [Ferret-talk] Problem getting "extract" from RDig In-Reply-To: <61a9516d719f4ef9a70273c4b8246f96@ruby-forum.com> References: <507ee400cea35b644322868b36f74460@ruby-forum.com> <61a9516d719f4ef9a70273c4b8246f96@ruby-forum.com> Message-ID: <39aa26c41af64daf2b29f3286e9d636f@ruby-forum.com> Eggman Eggman wrote: > If you're creating an index from a database, wouldn't you use AAF? As > far as I know, RDig is for indexing external pages. > > If you still want to try to get RDig to work, try crawling an external > URI. If that doesn't work, try it from the command line. I am using AAF for indexing module search. But for searching the entire site some thing that would search both the static and the dynamic content. I have no clue in how to make the AAF to search the static content of my application. If you have done a simillar stuff could you be kind and share your experience or code with me,,, Cheers, jazzy -- Posted via http://www.ruby-forum.com/. From david at freeswell.com Mon Oct 1 18:00:53 2007 From: david at freeswell.com (Dave Munson) Date: Tue, 2 Oct 2007 00:00:53 +0200 Subject: [Ferret-talk] Need Help with Custom Associations In-Reply-To: <20071001094352.GC5085@cordoba.webit.de> References: <20071001094352.GC5085@cordoba.webit.de> Message-ID: <2cace69953409fb4de54feb79e9ff819@ruby-forum.com> > > most probably the collection isn't there yet when aaf indexes your > record. Have a look at your log file to see what value aaf gets from > your method when it calls it. > Hmmm, I'm pretty new to this whole thing. I tried looking in my development.log file (140 gigs and counting!) and its showing nothing. I deleted my indexes and restarted the server and it picked up the keywords I was searching for... however this is my problem. Once I edit one of the records and remove a keyword, or add a keyword, its not reflected in the index I guess? Is this normal? Is it possible to have it act as a live search? -- Posted via http://www.ruby-forum.com/. From david at freeswell.com Mon Oct 1 18:09:57 2007 From: david at freeswell.com (Dave Munson) Date: Tue, 2 Oct 2007 00:09:57 +0200 Subject: [Ferret-talk] Need Help with Custom Associations In-Reply-To: <2cace69953409fb4de54feb79e9ff819@ruby-forum.com> References: <20071001094352.GC5085@cordoba.webit.de> <2cace69953409fb4de54feb79e9ff819@ruby-forum.com> Message-ID: <6c1805ab9c4a64de11d345d0d9bdc344@ruby-forum.com> > development.log file (140 gigs and counting!) and its showing nothing. Meant to say, 140 megs and counting... -- Posted via http://www.ruby-forum.com/. From lists at kikobu.com Mon Oct 1 16:33:03 2007 From: lists at kikobu.com (Morten) Date: Mon, 01 Oct 2007 22:33:03 +0200 Subject: [Ferret-talk] FileNotFoundError Message-ID: Hi, I saw someone else have this earlier. The recommendation is still to downgrade to 0.11.3? Oct 01 19:56:09 ey01-s00116 rails[3175]: Ferret::FileNotFoundError (File Not Found Error occured at :117 in xpop_contextError occured in fs_store .c:329 - fs_open_input tried to open "/data/zendesk/current/config/../index/production/ticket/_l.cfs" but it doesn't exist: ): /usr/lib64/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:285:in `delete' /usr/lib64/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb: 285:in `<<' /usr/lib64/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:8:in `synchrolock' /usr/lib64/ruby/1.8/monitor.rb:238:in `synchronize' /usr/lib64/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:8:in `synchrolock' /usr/lib64/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:267: in `<<' /vendor/plugins/acts_as_ferret/lib/local_index.rb:152:in `<<' /vendor/plugins/acts_as_ferret/lib/instance_methods.rb:73:in `ferret_create' Thanks. Morten From lists at kikobu.com Mon Oct 1 20:02:29 2007 From: lists at kikobu.com (Morten) Date: Tue, 02 Oct 2007 02:02:29 +0200 Subject: [Ferret-talk] FileNotFoundError In-Reply-To: References: Message-ID: Pardon. My DrB wasn't running. Br, Morten Morten wrote: > Hi, I saw someone else have this earlier. The recommendation is still to > downgrade to 0.11.3? > > Oct 01 19:56:09 ey01-s00116 rails[3175]: Ferret::FileNotFoundError (File > Not Found Error occured at :117 in xpop_contextError occured > in fs_store > .c:329 - fs_open_input tried to open > "/data/zendesk/current/config/../index/production/ticket/_l.cfs" but it > doesn't exist: y>): > /usr/lib64/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:285:in > `delete' /usr/lib64/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb: > 285:in `<<' > /usr/lib64/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:8:in > `synchrolock' /usr/lib64/ruby/1.8/monitor.rb:238:in `synchronize' > /usr/lib64/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:8:in > `synchrolock' > /usr/lib64/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:267: > in `<<' /vendor/plugins/acts_as_ferret/lib/local_index.rb:152:in `<<' > /vendor/plugins/acts_as_ferret/lib/instance_methods.rb:73:in > `ferret_create' > > Thanks. > > Morten From shigeruodani at yahoo.com Mon Oct 1 23:14:21 2007 From: shigeruodani at yahoo.com (Eggman Eggman) Date: Tue, 2 Oct 2007 05:14:21 +0200 Subject: [Ferret-talk] how to simply display the index In-Reply-To: <15fca432694d43719036315bbde06afd@ruby-forum.com> References: <15fca432694d43719036315bbde06afd@ruby-forum.com> Message-ID: <9b22714bd63361929c960a470de6448a@ruby-forum.com> Anyone? Just to provide more information - I want to make sure that the index is getting generated the way that I want it to be, and so I figured that the best way to check that would be to examine the index itself. Any help would be greatly appreciated. -- Posted via http://www.ruby-forum.com/. From bk at benjaminkrause.com Tue Oct 2 02:54:52 2007 From: bk at benjaminkrause.com (Benjamin Krause) Date: Tue, 2 Oct 2007 08:54:52 +0200 Subject: [Ferret-talk] FileNotFoundError In-Reply-To: References: Message-ID: On 2007-10-02, at 2:02 AM, Morten wrote: > > Pardon. My DrB wasn't running. :-) From bk at benjaminkrause.com Tue Oct 2 02:57:26 2007 From: bk at benjaminkrause.com (Benjamin Krause) Date: Tue, 2 Oct 2007 08:57:26 +0200 Subject: [Ferret-talk] how to simply display the index In-Reply-To: <9b22714bd63361929c960a470de6448a@ruby-forum.com> References: <15fca432694d43719036315bbde06afd@ruby-forum.com> <9b22714bd63361929c960a470de6448a@ruby-forum.com> Message-ID: On 2007-10-02, at 5:14 AM, Eggman Eggman wrote: > Anyone? > > Just to provide more information - I want to make sure that the > index is > getting generated the way that I want it to be, and so I figured that > the best way to check that would be to examine the index itself. I'm not quite sure how we can help you. But maybe as a start, take a look at the index by using the ferret-browser .. starting from 0.14 on, you'll have a ferret-browser script that you can start by pointing it to an index ... like that: bash$ ferret-browser my/index/directory [2007-10-02 08:56:52] INFO WEBrick 1.3.1 [2007-10-02 08:56:52] INFO ruby 1.8.6 (2007-03-13) [i686-darwin8.10.1] [2007-10-02 08:56:52] INFO WEBrick::HTTPServer#start: pid=1780 port=3301 then use your browser on http://localhost:3301 to examine you index. Ben From kraemer at webit.de Tue Oct 2 03:48:26 2007 From: kraemer at webit.de (Jens Kraemer) Date: Tue, 2 Oct 2007 09:48:26 +0200 Subject: [Ferret-talk] Need Help with Custom Associations In-Reply-To: <2cace69953409fb4de54feb79e9ff819@ruby-forum.com> References: <20071001094352.GC5085@cordoba.webit.de> <2cace69953409fb4de54feb79e9ff819@ruby-forum.com> Message-ID: <20071002074826.GF5085@cordoba.webit.de> On Tue, Oct 02, 2007 at 12:00:53AM +0200, Dave Munson wrote: > > > > most probably the collection isn't there yet when aaf indexes your > > record. Have a look at your log file to see what value aaf gets from > > your method when it calls it. > > > > Hmmm, I'm pretty new to this whole thing. I tried looking in my > development.log file (140 gigs and counting!) and its showing nothing. Aaf logs something like "Adding field fieldname with value 'fieldvalue' to index" whenever it indexes a record. > I deleted my indexes and restarted the server and it picked up the > keywords I was searching for... however this is my problem. > > Once I edit one of the records and remove a keyword, or add a keyword, > its not reflected in the index I guess? If everything works correctly, it should. How does your test code for adding a keyword and saving the record look like? > Is this normal? Is it possible to have it act as a live search? What do you mean by 'live search'? Search-as-you-type is no problem, but this hasn't to do much with indexing... Cheers, Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa From shigeruodani at yahoo.com Tue Oct 2 09:23:25 2007 From: shigeruodani at yahoo.com (Eggman Eggman) Date: Tue, 2 Oct 2007 15:23:25 +0200 Subject: [Ferret-talk] how to simply display the index In-Reply-To: References: <15fca432694d43719036315bbde06afd@ruby-forum.com> <9b22714bd63361929c960a470de6448a@ruby-forum.com> Message-ID: Ben - Thanks, this helps. From your response, I gather that people don't really examine the index itself. How then, do people typically test to make sure that they have the correct index structure and that documents are getting added to the index correctly? Suppose I want to add document titles to a 'title' field. How does one generally confirm that that's happening? Appreciated. -- Posted via http://www.ruby-forum.com/. From matthew.langham at indiginox.com Tue Oct 2 10:13:47 2007 From: matthew.langham at indiginox.com (Matthew Langham) Date: Tue, 2 Oct 2007 16:13:47 +0200 Subject: [Ferret-talk] deadlocks in Drb Server Message-ID: Hi, we still have the problem in that the Ferret Drb server dies on us sometimes. Looking through ferret_server.out and we come accross this: deadlock 0xb7261cb0: sleep:F(1012) - /usr/lib/ruby/1.8/drb/drb.rb:566 deadlock 0xb71d8654: sleep:F(409) - /usr/lib/ruby/1.8/drb/drb.rb:566 deadlock 0xb723f3e0: sleep:F(7) - /usr/lib/ruby/1.8/drb/drb.rb:566 deadlock 0xb72607c0: sleep:F(11) - /usr/lib/ruby/1.8/drb/drb.rb:566 deadlock 0xb7d44754: sleep:J(0xb71fab64) (main) - /var/www/web1/oms/current/script/ferret_start:70 deadlock 0xb71fab64: sleep:F(6) - /usr/lib/ruby/1.8/drb/drb.rb:944 deadlock 0xb726f158: sleep:S - /usr/lib/ruby/1.8/drb/drb.rb:626 /usr/lib/ruby/1.8/drb/drb.rb:626: Thread(0xb726f158): deadlock (fatal) Anyone have an idea what may be causing the problem and what we can do to get round it? Thanks Matthew -- Posted via http://www.ruby-forum.com/. From bk at benjaminkrause.com Tue Oct 2 11:47:09 2007 From: bk at benjaminkrause.com (Benjamin Krause) Date: Tue, 2 Oct 2007 17:47:09 +0200 Subject: [Ferret-talk] how to simply display the index In-Reply-To: References: <15fca432694d43719036315bbde06afd@ruby-forum.com> <9b22714bd63361929c960a470de6448a@ruby-forum.com> Message-ID: Well.. i do something like that: http://bugs.omdb.org/browser/trunk/test/unit/movie_ferret_index_test.rb http://bugs.omdb.org/browser/trunk/test/unit/person_ferret_test.rb but i don't test each ferret fields separately .. i guess that depends on your app .. i just test some critical fields .. but not everything .. Ben On 2007-10-02, at 3:23 PM, Eggman Eggman wrote: > Ben - Thanks, this helps. From your response, I gather that people > don't > really examine the index itself. How then, do people typically test to > make sure that they have the correct index structure and that > documents > are getting added to the index correctly? Suppose I want to add > document > titles to a 'title' field. How does one generally confirm that that's > happening? > > Appreciated. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk From bk at benjaminkrause.com Tue Oct 2 11:50:40 2007 From: bk at benjaminkrause.com (Benjamin Krause) Date: Tue, 2 Oct 2007 17:50:40 +0200 Subject: [Ferret-talk] deadlocks in Drb Server In-Reply-To: References: Message-ID: <7CFD381A-4961-4485-B70E-7E3E5CE17864@benjaminkrause.com> Hey .. do you have very high load on your drb? I serialize my indexing requests and did not yet have a deadlock, but then again, i'm not using aaf .. afaik, aaf uses separate threads to add documents to the index, so there *might* be a problem when you have a really high load.. but that's just speculation .. can you provide us with more information about the circumstances? Ben > Anyone have an idea what may be causing the problem and what we can do > to get round it? From ryan.mchale at gmail.com Wed Oct 3 03:21:43 2007 From: ryan.mchale at gmail.com (Ryan Hello, I try and run mongrel 1.0.1 and ferret 0.11.4 on Windows XP. To break mongrel all I have to do is invoke a class with Ferret in it. Here's my class: require 'ferret' include Ferret class SearchIndex def initialize print "SearchIndex:Initialize\n"; end end When I put this in my controller, I break mongrel: searchIndex = SearchIndex.new I can no longer perform a redirect_to properly. calls like this fail: redirect_to '/wiki/page/' I see this in the logs. Error calling Dispatcher.dispatch # If I comment out the call to the SearchIndex class, all is well. Ryan -- Posted via http://www.ruby-forum.com/. From myowntribe at yahoo.com Wed Oct 3 06:52:10 2007 From: myowntribe at yahoo.com (Cass Amino) Date: Wed, 3 Oct 2007 12:52:10 +0200 Subject: [Ferret-talk] Pagination problem with acts_as_ferret Message-ID: 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 the next 2 records. Also the result count is showing only 10 instead of 12 thats the right count. Here's my code: Controller: def search @users = User.available_users @user = User.find(session[:user_id]) @query = params[:query] || '' @total, @user_profiles = UserProfile.multi_search(@query, [ WorkProfile, SchoolProfile ], :page => (params[:page]||1)) @pages = pages_for(@total) unless @query.blank? @results = UserProfile.find_by_contents @query end end model: def self.multi_search(q, additional_models = [], options = {}) return nil if q.nil? or q=="" default_options = {:limit => 1, :page => 1} options = default_options.merge options # get the offset based on what page we're on options[:offset] = options[:limit] * (options.delete(:page).to_i-1) # now do the query with our options results = UserProfile.find_by_contents(q, options) return [results.total_hits, results] end view: <%= link_to 'Previous page', { :page => @pages.current.previous, :query => @query} if @pages.current.previous %> <%= pagination_links(@pages, :params => { :query=> @query }) %> <%= link_to 'Next page', { :page => @pages.current.next, :query => @query} if @pages.current.next %> Please do let me know how I get my pagination right... Cheers Cass -- Posted via http://www.ruby-forum.com/. From john at johnleach.co.uk Wed Oct 3 07:07:53 2007 From: john at johnleach.co.uk (John Leach) Date: Wed, 03 Oct 2007 12:07:53 +0100 Subject: [Ferret-talk] Pagination problem with acts_as_ferret In-Reply-To: References: Message-ID: <1191409673.15226.21.camel@dogen.thepride.> Hi Cass, I think this is a bug in acts_as_ferret. On line 163 in class_methods.rb the limit variable is used but hasn't been initialised: http://projects.jkraemer.net/acts_as_ferret/browser/trunk/plugin/acts_as_ferret/lib/class_methods.rb In the mean time, aaf actually has paging support in there and that looks like it should work fine. So instead of using :limit and :offset in your options for find_by_contents, drop all your page number calculations and use :per_page and :page. Aaf will then figure out the limit and offset for you. John. -- http://www.brightbox.co.uk - UK Ruby on Rails Hosting On Wed, 2007-10-03 at 12:52 +0200, Cass Amino wrote: > 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 the > next 2 records. Also the result count is showing only 10 instead of 12 > thats the right count. > > > Here's my code: > > Controller: > > def search > @users = User.available_users > @user = User.find(session[:user_id]) > @query = params[:query] || '' > @total, @user_profiles = UserProfile.multi_search(@query, [ WorkProfile, > SchoolProfile ], :page => (params[:page]||1)) > @pages = pages_for(@total) > unless @query.blank? > @results = UserProfile.find_by_contents @query > end > end > > > > model: > > def self.multi_search(q, additional_models = [], options = {}) > return nil if q.nil? or q=="" > default_options = {:limit => 1, :page => 1} > options = default_options.merge options > # get the offset based on what page we're on > options[:offset] = options[:limit] * (options.delete(:page).to_i-1) > # now do the query with our options > results = UserProfile.find_by_contents(q, options) > return [results.total_hits, results] > end From jk at jkraemer.net Wed Oct 3 07:50:26 2007 From: jk at jkraemer.net (Jens Kraemer) Date: Wed, 3 Oct 2007 13:50:26 +0200 Subject: [Ferret-talk] Pagination problem with acts_as_ferret In-Reply-To: <1191409673.15226.21.camel@dogen.thepride.> References: <1191409673.15226.21.camel@dogen.thepride.> Message-ID: <20071003115026.GL29859@thunder.jkraemer.net> On Wed, Oct 03, 2007 at 12:07:53PM +0100, John Leach wrote: > Hi Cass, > > I think this is a bug in acts_as_ferret. On line 163 in > class_methods.rb the limit variable is used but hasn't been initialised: > > http://projects.jkraemer.net/acts_as_ferret/browser/trunk/plugin/acts_as_ferret/lib/class_methods.rb > > In the mean time, aaf actually has paging support in there and that > looks like it should work fine. > > So instead of using :limit and :offset in your options for > find_by_contents, drop all your page number calculations and > use :per_page and :page. Aaf will then figure out the limit and offset > for you. exactly. Use the latest trunk of the plugin, and use the find_with_ferret method with the :multi option instead of multi_search: Model.find_with_ferret query, :page => params[:page], :per_page => 10, :multi => [ Model2, Model3 ] cheers, Jens > > John. > -- > http://www.brightbox.co.uk - UK Ruby on Rails Hosting > > On Wed, 2007-10-03 at 12:52 +0200, Cass Amino wrote: > > 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 the > > next 2 records. Also the result count is showing only 10 instead of 12 > > thats the right count. > > > > > > Here's my code: > > > > Controller: > > > > def search > > @users = User.available_users > > @user = User.find(session[:user_id]) > > @query = params[:query] || '' > > @total, @user_profiles = UserProfile.multi_search(@query, [ WorkProfile, > > SchoolProfile ], :page => (params[:page]||1)) > > @pages = pages_for(@total) > > unless @query.blank? > > @results = UserProfile.find_by_contents @query > > end > > end > > > > > > > > model: > > > > def self.multi_search(q, additional_models = [], options = {}) > > return nil if q.nil? or q=="" > > default_options = {:limit => 1, :page => 1} > > options = default_options.merge options > > # get the offset based on what page we're on > > options[:offset] = options[:limit] * (options.delete(:page).to_i-1) > > # now do the query with our options > > results = UserProfile.find_by_contents(q, options) > > return [results.total_hits, results] > > end > > > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk -- Jens Kr?mer http://www.jkraemer.net/ - Blog http://www.omdb.org/ - The new free film database From jk at jkraemer.net Wed Oct 3 08:04:51 2007 From: jk at jkraemer.net (Jens Kraemer) Date: Wed, 3 Oct 2007 14:04:51 +0200 Subject: [Ferret-talk] deadlocks in Drb Server In-Reply-To: References: Message-ID: <20071003120451.GM29859@thunder.jkraemer.net> On Tue, Oct 02, 2007 at 04:13:47PM +0200, Matthew Langham wrote: > Hi, > > we still have the problem in that the Ferret Drb server dies on us > sometimes. Looking through ferret_server.out and we come accross this: > > deadlock 0xb7261cb0: sleep:F(1012) - /usr/lib/ruby/1.8/drb/drb.rb:566 > deadlock 0xb71d8654: sleep:F(409) - /usr/lib/ruby/1.8/drb/drb.rb:566 > deadlock 0xb723f3e0: sleep:F(7) - /usr/lib/ruby/1.8/drb/drb.rb:566 > deadlock 0xb72607c0: sleep:F(11) - /usr/lib/ruby/1.8/drb/drb.rb:566 > deadlock 0xb7d44754: sleep:J(0xb71fab64) (main) - > /var/www/web1/oms/current/script/ferret_start:70 > deadlock 0xb71fab64: sleep:F(6) - /usr/lib/ruby/1.8/drb/drb.rb:944 > deadlock 0xb726f158: sleep:S - /usr/lib/ruby/1.8/drb/drb.rb:626 > /usr/lib/ruby/1.8/drb/drb.rb:626: Thread(0xb726f158): deadlock (fatal) > > > Anyone have an idea what may be causing the problem and what we can do > to get round it? To be honest, I have no idea where this might come from - this trace looks like it would be worth an email to DRb's author. As Ben wrote, changing the way the DRb server works might help to prevent this. Option 1) would be to synchronize all calls to the DRb server's methods, #method_missing in ferret_server.rb would be a good place to implement this. Performance will suffer, but it might be worth a try. Option 2) is how we did it in omdb.org's DRb server - queue all indexing requests and work through the queue in a separate thread. Omdb.org uses local IndexSearcher instances to save the DRb server from handling search. Cheers, Jens PS: There are plans to give aaf and especially the DRb server a major overhaul, and to incorporate several of the ideas from the omdb.org solution. However this won't be ready before November, I guess. -- Jens Kr?mer http://www.jkraemer.net/ - Blog http://www.omdb.org/ - The new free film database From myowntribe at yahoo.com Wed Oct 3 08:39:25 2007 From: myowntribe at yahoo.com (Cass Amino) Date: Wed, 3 Oct 2007 14:39:25 +0200 Subject: [Ferret-talk] Pagination problem with acts_as_ferret In-Reply-To: <20071003115026.GL29859@thunder.jkraemer.net> References: <1191409673.15226.21.camel@dogen.thepride.> <20071003115026.GL29859@thunder.jkraemer.net> Message-ID: <499b3214f7ed97a57996c157da404308@ruby-forum.com> Hi John and Jens, Thanks a ton for your guidance, I got it right now after making the changes. Cheers Cass Jens Kraemer wrote: > On Wed, Oct 03, 2007 at 12:07:53PM +0100, John Leach wrote: >> So instead of using :limit and :offset in your options for >> find_by_contents, drop all your page number calculations and >> use :per_page and :page. Aaf will then figure out the limit and offset >> for you. > > exactly. Use the latest trunk of the plugin, and use the > find_with_ferret method with the :multi option instead of multi_search: > > Model.find_with_ferret query, :page => params[:page], :per_page => 10, > :multi => [ Model2, Model3 ] > > > cheers, > Jens > > >> > >> > >> > @results = UserProfile.find_by_contents @query >> > options = default_options.merge options >> Ferret-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ferret-talk > -- > Jens Kr?mer > http://www.jkraemer.net/ - Blog > http://www.omdb.org/ - The new free film database -- Posted via http://www.ruby-forum.com/. From ryan.mchale at gmail.com Wed Oct 3 09:34:29 2007 From: ryan.mchale at gmail.com (Ryan McHale) Date: Wed, 3 Oct 2007 15:34:29 +0200 Subject: [Ferret-talk] Ferret and Mongrel and redirect_to In-Reply-To: References: Message-ID: <6fa65da3ab29fa9f92c2f09d0f09443e@ruby-forum.com> Ryan McHale wrote: Looks like this fixed it: http://www.ruby-forum.com/topic/90752#188252 Ie: moving the include inside my class. I definitely think this should be mentioned in the documentation some where. Ryan > Hello, > > I try and run mongrel 1.0.1 and ferret 0.11.4 on Windows XP. > > To break mongrel all I have to do is invoke a class with Ferret in it. > > Here's my class: > > require 'ferret' > include Ferret > > class SearchIndex > > def initialize > print "SearchIndex:Initialize\n"; > end > > end > > > When I put this in my controller, I break mongrel: > searchIndex = SearchIndex.new > > I can no longer perform a redirect_to properly. > calls like this fail: redirect_to '/wiki/page/' > > I see this in the logs. > Error calling Dispatcher.dispatch # Object::Document> > > If I comment out the call to the SearchIndex class, all is well. > > > Ryan -- Posted via http://www.ruby-forum.com/. From lists at kikobu.com Wed Oct 3 16:08:32 2007 From: lists at kikobu.com (Morten) Date: Wed, 03 Oct 2007 22:08:32 +0200 Subject: [Ferret-talk] The ferret logs Message-ID: Hi. We've had some problems with ferret not being able to load our classes (stack trace below for the curious). I nailed it down to a deployment issue, where an old instance of ferret drb was running. I don't understand the details quite yet, but the result was the the old ferret was never shutdown during redeployment, and attempts were made to start up a new one. Anywho, I stumbled acroess the ferret_server.log and ferret_index.log, is it correctly understood, that ferret_server.log is basically the drb server output, while ferret_index.log is the index manager output? A bonus question, what's the best way to determine that your application (using acts_as_ferret) is currently running against the drb server rather than the file system? Thanks! :-) Morten uninitialized constant Ticket (druby://127.0.0.1:9009) ./script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:266:in `load_missing_constant' (druby://127.0.0.1:9009) ./script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:452:in `const_missing' (druby://127.0.0.1:9009) ./script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:464:in `const_missing' (druby://127.0.0.1:9009) ./script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/inflector.rb:250:in `constantize' (druby://127.0.0.1:9009) ./script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/core_ext/string/inflections.rb:148:in `constantize' (druby://127.0.0.1:9009) ./script/../config/../vendor/plugins/acts_as_ferret/lib/ferret_server.rb:112:in `with_class' (druby://127.0.0.1:9009) ./script/../config/../vendor/plugins/acts_as_ferret/lib/ferret_server.rb:78:in `ensure_index_exists' /data/fiddle/current/config/../vendor/plugins/acts_as_ferret/lib/remote_index.rb:16:in `send' /data/fiddle/current/config/../vendor/plugins/acts_as_ferret/lib/remote_index.rb:16:in `method_missing' /data/fiddle/current/config/../vendor/plugins/acts_as_ferret/lib/act_methods.rb:182:in `acts_as_ferret' /data/fiddle/current/config/../app/models/ticket.rb:37 From kraemer at webit.de Thu Oct 4 04:08:34 2007 From: kraemer at webit.de (Jens Kraemer) Date: Thu, 4 Oct 2007 10:08:34 +0200 Subject: [Ferret-talk] Ferret and Mongrel and redirect_to In-Reply-To: <6fa65da3ab29fa9f92c2f09d0f09443e@ruby-forum.com> References: <6fa65da3ab29fa9f92c2f09d0f09443e@ruby-forum.com> Message-ID: <20071004080834.GG5085@cordoba.webit.de> On Wed, Oct 03, 2007 at 03:34:29PM +0200, Ryan McHale wrote: > Ryan McHale wrote: > > Looks like this fixed it: > http://www.ruby-forum.com/topic/90752#188252 > > Ie: moving the include inside my class. good to know. > I definitely think this should be mentioned in the documentation some > where. Just added it to the Wiki: http://projects.jkraemer.net/acts_as_ferret/wiki/gotchas#StrangeproblemswhenusingcustomAnalyzers Cheers, Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa From matthew.langham at indiginox.com Thu Oct 4 05:50:07 2007 From: matthew.langham at indiginox.com (Matthew Langham) Date: Thu, 4 Oct 2007 11:50:07 +0200 Subject: [Ferret-talk] deadlocks in Drb Server In-Reply-To: <20071003120451.GM29859@thunder.jkraemer.net> References: <20071003120451.GM29859@thunder.jkraemer.net> Message-ID: <759e46506eb6fe40bcb77eadbadd3bca@ruby-forum.com> Thanks for the tips guys. We'll look closer and see if we can come up with more specific details on when this happens. At the moment we have low load on the system but call rebuild_index every now and again. Our guess is that this may be causing the problems - but again, we'll give it a closer look. Matthew -- Posted via http://www.ruby-forum.com/. From eimorton at gmail.com Thu Oct 4 11:15:46 2007 From: eimorton at gmail.com (Erik Morton) Date: Thu, 4 Oct 2007 11:15:46 -0400 Subject: [Ferret-talk] Offline indexing issues Message-ID: If I disable ferret in my environment file and then run a cron job every hour to index the records that have been added/changed, do I enable Ferret just in the script that does the hourly indexing? Or do I somehow need to tell the process that runs the Ferret DRB server that it should start writing to the index again? Thanks in advance. Erik From eimorton at gmail.com Thu Oct 4 11:56:36 2007 From: eimorton at gmail.com (Erik Morton) Date: Thu, 4 Oct 2007 11:56:36 -0400 Subject: [Ferret-talk] Offline indexing issues In-Reply-To: References: Message-ID: <90BBB086-45A4-40AF-BE00-D1ADCD3FF55D@gmail.com> Follow Up. I have 5 mongrels and a ferret drb server running on the same machine. In environment.rb I disable ferret like so: MyModel.disable_ferret I have a script that runs every hour that does the following: MyModel.enable_ferret MyModel.bulk_index all_records_created_or_changed_in_the_last_hour Now, ClassMethods defines bulk_index as: def bulk_index(*ids) ids = ids.first if ids.size == 1 && ids.first.is_a?(Enumerable) aaf_index.bulk_index(ids) end aaf_index is an instance of RemoteIndex that dispatches bulk_index to the drb server, correct? If that's the case, then the Server class sends the method call to the aaf_index, which has bulk_index defined in ferret_extensions.rb, correct? the bulk_index method uses the BulkIndexer.index_records method, which checks to see if ferret is enbled for each record: rec.ferret_enabled?(true). Now, if this all happens in the Drb server, wouldn't ferret be disabled there as it is obviously using the same environment.rb file that disables ferret for MyModel? Thanks in advance. On Oct 4, 2007, at 11:15 AM, Erik Morton wrote: > If I disable ferret in my environment file and then run a cron job > every hour to index the records that have been added/changed, do I > enable Ferret just in the script that does the hourly indexing? Or > do I somehow need to tell the process that runs the Ferret DRB > server that it should start writing to the index again? Thanks in > advance. > > Erik From chapambrose at gmail.com Thu Oct 4 17:01:24 2007 From: chapambrose at gmail.com (Chap Ambrose) Date: Thu, 4 Oct 2007 17:01:24 -0400 Subject: [Ferret-talk] Help Installing Ferret Gem on Media Temple Grid Server Message-ID: It seems that I've successfully installed the ferret gem on my Media Temple Grid Server [ ferret 0.11.4 (ruby) ] but now my application won't start and gives me this error in my mongrel.log /home/25280/data/rubygems/gems/gems/ferret- 0.11.4/lib/ferret_ext.so: libruby1.8.so.1.8: cannot open shared object file: No such file or directory - /home/25280/data/rubygems/gems /gems/ferret-0.11.4/lib/ferret_ext.so (LoadError) It looks like this is a shared libraries problem, but I've tried doing some LD_LIBRARY_PATH= with no luck. My local install of ruby is here //data/rubygems/local/lib/site_ruby/1.8 (i think) but I can't even seem to find the libruby1.8.so.1.8 file. I'm really having a tough time and would appreciate any help. Please be explicit with any assistance as I'm still a student of all this goodness. -- Chap -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20071004/a42be599/attachment-0001.html From bk at benjaminkrause.com Thu Oct 4 18:17:35 2007 From: bk at benjaminkrause.com (Benjamin Krause) Date: Fri, 5 Oct 2007 00:17:35 +0200 Subject: [Ferret-talk] Help Installing Ferret Gem on Media Temple Grid Server In-Reply-To: References: Message-ID: Hey .. the gem hasn't been installed successfully. Most probably you don't have a compiler installed. try to install the ferret gem manually and see if it succeeds. Post the log here, if you see any error. Ben On 2007-10-04, at 11:01 PM, Chap Ambrose wrote: > It seems that I've successfully installed the ferret gem on my > Media Temple Grid Server [ ferret 0.11.4 (ruby) ] but now my > application won't start and gives me this error in my mongrel.log > > /home/25280/data/rubygems/gems/gems/ferret- 0.11.4/lib/ > ferret_ext.so: libruby1.8.so.1.8: cannot open shared object file: > No such file or directory - /home/25280/data/rubygems/gems /gems/ > ferret-0.11.4/lib/ferret_ext.so (LoadError) > It looks like this is a shared libraries problem, but I've tried > doing some LD_LIBRARY_PATH= with no luck. > > My local install of ruby is here //data/rubygems/local/lib/site > _ruby/1.8 (i think) but I can't even seem to find the libruby1.8.so. > 1.8 file. > > I'm really having a tough time and would appreciate any help. > Please be explicit with any assistance as I'm still a student of > all this goodness. > > -- > Chap > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk From tomtoday at gmail.com Fri Oct 5 00:07:47 2007 From: tomtoday at gmail.com (Tom Brice) Date: Fri, 5 Oct 2007 06:07:47 +0200 Subject: [Ferret-talk] DRbConnError when using script/runner Message-ID: <0687ce7e49110816013cd2b395f36813@ruby-forum.com> I am running ferret (0.11.4) and acts_as_ferret (stable from svn) in a rails 1.2.3 app in production using the DRb server. I recently upgraded my configuration and the method with which I start and stop the server no longer works: Here is the command I would like to use (and have used in the past) to start the aaf server: $ /Library/WebServer/rails/ccdb/current/script/runner -e production /Library/WebServer/rails/ccdb/current/script/ferret_start /opt/local/lib/ruby/1.8/drb/drb.rb:736:in `open': druby://localhost:9090 - # (DRb::DRbConnError) from /opt/local/lib/ruby/1.8/drb/drb.rb:729:in `each' from /opt/local/lib/ruby/1.8/drb/drb.rb:729:in `open' from /opt/local/lib/ruby/1.8/drb/drb.rb:1189:in `initialize' from /opt/local/lib/ruby/1.8/drb/drb.rb:1169:in `new' from /opt/local/lib/ruby/1.8/drb/drb.rb:1169:in `open' from /opt/local/lib/ruby/1.8/drb/drb.rb:1085:in `method_missing' from /opt/local/lib/ruby/1.8/drb/drb.rb:1103:in `with_friend' from /opt/local/lib/ruby/1.8/drb/drb.rb:1084:in `method_missing' ... 28 levels... from /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/railties/lib/commands/runner.rb:39:in `require' from /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/railties/lib/commands/runner.rb:39 from /Library/WebServer/rails/ccdb/current/script/runner:3:in `require' from /Library/WebServer/rails/ccdb/current/script/runner:3 Strangely the follwoing command works: $ cd /Library/WebServer/rails/ccdb/current && RAILS_ENV=production /Library/WebServer/rails/ccdb/current/script/ferret_start Starting ferret DRb server...Done. I would simply switch to that but I am on an Xserve and I'm using launchd to start the aaf server on reboot. launchd does not seem to like the command that works. Anyone know why I would get a DRbConnError when using script/runner? Thanks in advance, Tom -- Posted via http://www.ruby-forum.com/. From kraemer at webit.de Fri Oct 5 04:06:16 2007 From: kraemer at webit.de (Jens Kraemer) Date: Fri, 5 Oct 2007 10:06:16 +0200 Subject: [Ferret-talk] DRbConnError when using script/runner In-Reply-To: <0687ce7e49110816013cd2b395f36813@ruby-forum.com> References: <0687ce7e49110816013cd2b395f36813@ruby-forum.com> Message-ID: <20071005080615.GK5085@cordoba.webit.de> Hi! most probably this happens because with script/runner, your model classes get loaded before the server gets a chance to tell them they shouldn't run in remote mode. Hence aaf tries to connect to the DRb server, which of course is impossible since it hasn't been started up yet, resulting in the error you see. Try to set the environment variable FERRET_USE_LOCAL_INDEX to 'true' in your launch command: $ FERRET_USE_LOCAL_INDEX=true /Library/WebServer/rails/ccdb/current/script/runner -e production /Library/WebServer/rails/ccdb/current/script/ferret_start cheers, Jens On Fri, Oct 05, 2007 at 06:07:47AM +0200, Tom Brice wrote: > I am running ferret (0.11.4) and acts_as_ferret (stable from svn) in a > rails 1.2.3 app in production using the DRb server. I recently upgraded > my configuration and the method with which I start and stop the server > no longer works: Here is the command I would like to use (and have used > in the past) to start the aaf server: > > $ /Library/WebServer/rails/ccdb/current/script/runner -e production > /Library/WebServer/rails/ccdb/current/script/ferret_start > /opt/local/lib/ruby/1.8/drb/drb.rb:736:in `open': druby://localhost:9090 > - # > (DRb::DRbConnError) > from /opt/local/lib/ruby/1.8/drb/drb.rb:729:in `each' > from /opt/local/lib/ruby/1.8/drb/drb.rb:729:in `open' > from /opt/local/lib/ruby/1.8/drb/drb.rb:1189:in `initialize' > from /opt/local/lib/ruby/1.8/drb/drb.rb:1169:in `new' > from /opt/local/lib/ruby/1.8/drb/drb.rb:1169:in `open' > from /opt/local/lib/ruby/1.8/drb/drb.rb:1085:in `method_missing' > from /opt/local/lib/ruby/1.8/drb/drb.rb:1103:in `with_friend' > from /opt/local/lib/ruby/1.8/drb/drb.rb:1084:in `method_missing' > ... 28 levels... > from > /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/railties/lib/commands/runner.rb:39:in > `require' > from > /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/railties/lib/commands/runner.rb:39 > from /Library/WebServer/rails/ccdb/current/script/runner:3:in > `require' > from /Library/WebServer/rails/ccdb/current/script/runner:3 > > Strangely the follwoing command works: > > $ cd /Library/WebServer/rails/ccdb/current && RAILS_ENV=production > /Library/WebServer/rails/ccdb/current/script/ferret_start > Starting ferret DRb server...Done. > > I would simply switch to that but I am on an Xserve and I'm using > launchd to start the aaf server on reboot. launchd does not seem to > like the command that works. > > Anyone know why I would get a DRbConnError when using script/runner? > > Thanks in advance, > Tom > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk > -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa From kraemer at webit.de Fri Oct 5 04:41:57 2007 From: kraemer at webit.de (Jens Kraemer) Date: Fri, 5 Oct 2007 10:41:57 +0200 Subject: [Ferret-talk] Offline indexing issues In-Reply-To: <90BBB086-45A4-40AF-BE00-D1ADCD3FF55D@gmail.com> References: <90BBB086-45A4-40AF-BE00-D1ADCD3FF55D@gmail.com> Message-ID: <20071005084157.GL5085@cordoba.webit.de> On Thu, Oct 04, 2007 at 11:56:36AM -0400, Erik Morton wrote: > Follow Up. I have 5 mongrels and a ferret drb server running on the > same machine. In environment.rb I disable ferret like so: > > MyModel.disable_ferret > > I have a script that runs every hour that does the following: > > MyModel.enable_ferret > MyModel.bulk_index all_records_created_or_changed_in_the_last_hour > > Now, ClassMethods defines bulk_index as: > > def bulk_index(*ids) > ids = ids.first if ids.size == 1 && ids.first.is_a?(Enumerable) > aaf_index.bulk_index(ids) > end > > aaf_index is an instance of RemoteIndex that dispatches bulk_index to > the drb server, correct? If that's the case, then the Server class > sends the method call to the aaf_index, which has bulk_index defined > in ferret_extensions.rb, correct? the bulk_index method uses the > BulkIndexer.index_records method, which checks to see if ferret is > enbled for each record: rec.ferret_enabled?(true). Now, if this all > happens in the Drb server, wouldn't ferret be disabled there as it is > obviously using the same environment.rb file that disables ferret for > MyModel? Exactly. Since with bulk_index (and rebuild_index, too) the ferret_enabled? check always only happens in the DRb server, calling MyModel.enable_ferret on the client side has no effect. I just fixed this - instance.ferret_enabled? now ignores the class level ferret_enabled state when called by the bulk indexer (which is also used by the rebuild_index method, so the same behaviour applies there). I think the behaviour now is more useful - when you disable ferret at the class level and then explicitly call bulk_index or rebuild_index on this class, aaf assumes you have a good reason to do so and just does what you say. Cheers, Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa From kraemer at webit.de Fri Oct 5 04:50:41 2007 From: kraemer at webit.de (Jens Kraemer) Date: Fri, 5 Oct 2007 10:50:41 +0200 Subject: [Ferret-talk] The ferret logs In-Reply-To: References: Message-ID: <20071005085041.GM5085@cordoba.webit.de> On Wed, Oct 03, 2007 at 10:08:32PM +0200, Morten wrote: > > Hi. > > We've had some problems with ferret not being able to load our classes > (stack trace below for the curious). > > I nailed it down to a deployment issue, where an old instance of ferret > drb was running. I don't understand the details quite yet, but the > result was the the old ferret was never shutdown during redeployment, > and attempts were made to start up a new one. > > Anywho, I stumbled acroess the ferret_server.log and ferret_index.log, > is it correctly understood, that ferret_server.log is basically the drb > server output, while ferret_index.log is the index manager output? exactly. ferret_server.log is written by the DRb part of acts_as_ferret, while ferret_index.log is written by the indexing code common to local and DRb mode. > A bonus question, what's the best way to determine that your application > (using acts_as_ferret) is currently running against the drb server > rather than the file system? If your log level (set in ferret_server.yml) is on debug, ferret_server.log should have an entry for each method call received via DRb. In your application, you may check Model.aaf_configuration[:remote] to see if remote access is active. Besides that, your app should refuse to start up if it's configured for remote mode and no server is there. Cheers, Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa From tomtoday at gmail.com Fri Oct 5 14:52:34 2007 From: tomtoday at gmail.com (Tom Brice) Date: Fri, 5 Oct 2007 20:52:34 +0200 Subject: [Ferret-talk] DRbConnError when using script/runner In-Reply-To: <20071005080615.GK5085@cordoba.webit.de> References: <0687ce7e49110816013cd2b395f36813@ruby-forum.com> <20071005080615.GK5085@cordoba.webit.de> Message-ID: <45b3e7cecac81ef89cfc6156a171769c@ruby-forum.com> Jens Kraemer wrote: > ...> Try to set the environment variable FERRET_USE_LOCAL_INDEX to 'true' in > your launch command: > > $ FERRET_USE_LOCAL_INDEX=true > /Library/WebServer/rails/ccdb/current/script/runner -e production > /Library/WebServer/rails/ccdb/current/script/ferret_start > Thanks for the quick reply. Unfortunately that did not work. Different error however: $ FERRET_USE_LOCAL_INDEX=true /Library/WebServer/rails/ccdb/current/script/runner -e production /Library/WebServer/rails/ccdb/current/script/ferret_start /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/railties/lib/commands/runner.rb:45: /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- ./../config/boot (MissingSourceFile) from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `require' from /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in `require' from /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in' from /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in `require' from (eval):21 Any advice? Again thanks for the assistance. I have a feeling this is related to the server platform (OS X Server 10.4.10). Do people on Linux get these kind of errors? Tom -- Posted via http://www.ruby-forum.com/. From kraemer at webit.de Sat Oct 6 11:42:07 2007 From: kraemer at webit.de (Jens Kraemer) Date: Sat, 6 Oct 2007 17:42:07 +0200 Subject: [Ferret-talk] DRbConnError when using script/runner In-Reply-To: <45b3e7cecac81ef89cfc6156a171769c@ruby-forum.com> References: <0687ce7e49110816013cd2b395f36813@ruby-forum.com> <20071005080615.GK5085@cordoba.webit.de> <45b3e7cecac81ef89cfc6156a171769c@ruby-forum.com> Message-ID: <20071006154207.GA20114@cordoba.webit.de> Hi! I just committed a slight change to the ferret_start script which should fix this. Here's the changeset: http://projects.jkraemer.net/acts_as_ferret/changeset/252 You'll still need the FERRET_USE_LOCAL_INDEX environment variable, however. Cheers, Jens On Fri, Oct 05, 2007 at 08:52:34PM +0200, Tom Brice wrote: > Jens Kraemer wrote: > > ...> Try to set the environment variable FERRET_USE_LOCAL_INDEX to 'true' in > > your launch command: > > > > $ FERRET_USE_LOCAL_INDEX=true > > /Library/WebServer/rails/ccdb/current/script/runner -e production > > /Library/WebServer/rails/ccdb/current/script/ferret_start > > > > Thanks for the quick reply. Unfortunately that did not work. Different > error however: > > $ FERRET_USE_LOCAL_INDEX=true > /Library/WebServer/rails/ccdb/current/script/runner -e production > /Library/WebServer/rails/ccdb/current/script/ferret_start > /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/railties/lib/commands/runner.rb:45: > /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- ./../config/boot > (MissingSourceFile) > from > /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from > /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in > `require' > from > /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in > `new_constants_in' > from > /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in > `require' > from (eval):21 > > Any advice? > > Again thanks for the assistance. I have a feeling this is related to > the server platform (OS X Server 10.4.10). Do people on Linux get these > kind of errors? > > Tom > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk > -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa From tomtoday at gmail.com Sat Oct 6 11:49:15 2007 From: tomtoday at gmail.com (Tom Brice) Date: Sat, 6 Oct 2007 17:49:15 +0200 Subject: [Ferret-talk] DRbConnError when using script/runner In-Reply-To: <20071006154207.GA20114@cordoba.webit.de> References: <0687ce7e49110816013cd2b395f36813@ruby-forum.com> <20071005080615.GK5085@cordoba.webit.de> <45b3e7cecac81ef89cfc6156a171769c@ruby-forum.com> <20071006154207.GA20114@cordoba.webit.de> Message-ID: <83e2d9e67c128b8093549a1cb13bdbf8@ruby-forum.com> Jens Kraemer wrote: > Hi! > > I just committed a slight change to the ferret_start script which should > fix this. Thanks a bunch Jens! I will give it a go and report back. Tom -- Posted via http://www.ruby-forum.com/. From tomtoday at gmail.com Sat Oct 6 12:23:02 2007 From: tomtoday at gmail.com (Tom Brice) Date: Sat, 6 Oct 2007 18:23:02 +0200 Subject: [Ferret-talk] DRbConnError when using script/runner In-Reply-To: <20071006154207.GA20114@cordoba.webit.de> References: <0687ce7e49110816013cd2b395f36813@ruby-forum.com> <20071005080615.GK5085@cordoba.webit.de> <45b3e7cecac81ef89cfc6156a171769c@ruby-forum.com> <20071006154207.GA20114@cordoba.webit.de> Message-ID: Jens Kraemer wrote: > Hi! > > I just committed a slight change to the ferret_start script which should > fix this. > > Here's the changeset: > http://projects.jkraemer.net/acts_as_ferret/changeset/252 > > You'll still need the FERRET_USE_LOCAL_INDEX environment variable, > however. > > Cheers, > Jens FIXED! Works like a charm now. That really makes my week. Adding aaf search was so simple and now that this minor inconvienence is fixed I'm a happy programmer. Thanks for creating such a great tool. Tom -- Posted via http://www.ruby-forum.com/. From alex at stacktrace.com Sun Oct 7 00:03:06 2007 From: alex at stacktrace.com (Mitch Mon) Date: Sun, 7 Oct 2007 06:03:06 +0200 Subject: [Ferret-talk] ferret performance before optimization Message-ID: <5fcfca32e9e3f6351e48a14279b31331@ruby-forum.com> My problem is that I am adding on the order of hundreds of records, so not that many. The index is REALLY slow after I start adding records until I call optimize_index (I added a method for that - it's a ferret function). Then it drops from >2 seconds to ~100ms per query. I figure the bulk_index functionality will help close the window of slowness, but not ideal and I don't know when that will be added to a stable tag. Any idea why this would happen or how to avoid it? Thanks -- Posted via http://www.ruby-forum.com/. From carchase at gmail.com Sun Oct 7 22:30:12 2007 From: carchase at gmail.com (Chase DuBois) Date: Mon, 8 Oct 2007 04:30:12 +0200 Subject: [Ferret-talk] Can you alias fields in acts_as_ferret? Message-ID: <5ec92d607031cd9c350e5ca3be235c6e@ruby-forum.com> Is there any way to set a field name that is different than the method name used to populate it? My example: In Rails, I'm using acts_as_ferret on a Article model that has_many Authors. I want to be able to index authors' names with each article. Since @article.authors yields an array of Author objects (and not an indexable string), I've created this method in my Article model: def authors_aaf @authors.collect {|a| a.name }.to_sentence end I call it "authors_aaf" because "authors" would cause a conflict. But I want my field name to be "authors", because that makes the most sense. (Users shouldn't have to type "authors_aaf:Joe" to search by author.) Any idea how this can/should be done? -- Posted via http://www.ruby-forum.com/. From cstrom at mdlogix.com Mon Oct 8 07:11:24 2007 From: cstrom at mdlogix.com (Chris Strom) Date: Mon, 8 Oct 2007 07:11:24 -0400 Subject: [Ferret-talk] Can you alias fields in acts_as_ferret? In-Reply-To: <5ec92d607031cd9c350e5ca3be235c6e@ruby-forum.com> References: <5ec92d607031cd9c350e5ca3be235c6e@ruby-forum.com> Message-ID: <20071008111124.GA5736@jaynestown.users.mdlogix.com> On Mon, Oct 08, 2007 at 04:30:12AM +0200, Chase DuBois wrote: > Is there any way to set a field name that is different than the method > name used to populate it? > > My example: > > In Rails, I'm using acts_as_ferret on a Article model that has_many > Authors. I want to be able to index authors' names with each article. > Since @article.authors yields an array of Author objects (and not an > indexable string), I've created this method in my Article model: > > def authors_aaf > @authors.collect {|a| a.name }.to_sentence > end > > I call it "authors_aaf" because "authors" would cause a conflict. But I > want my field name to be "authors", because that makes the most sense. > (Users shouldn't have to type "authors_aaf:Joe" to search by author.) > > Any idea how this can/should be done? You could pass the query through a de-aliasing helper method - something that does query.gsub!(/authors:/, 'authors_aaf:') - before handing off the query string to ferret. -Chris From neongrau at gmail.com Mon Oct 8 12:15:08 2007 From: neongrau at gmail.com (neongrau __) Date: Mon, 8 Oct 2007 18:15:08 +0200 Subject: [Ferret-talk] wildcard searches with german umlauts Message-ID: <3044da43b29cfcf68007847b07e98ef4@ruby-forum.com> i just noticed a weird problem. i can successfully search with full terms like "Fl?chendesinfektionsstufen" or "Regionalan?sthesie" for example and get correct hits. but when i search for those entries with wildcards "Fl?chendesinfektion*" or "Regionalan?s*" it won't find anything while "*chendesinfektionsstufen" or "*sthesie" works. so any wildcarded search that contains any umlauts will fail. anyone any idea or hint what the problem could be? -- Posted via http://www.ruby-forum.com/. From pjones at pmade.com Mon Oct 8 12:51:44 2007 From: pjones at pmade.com (Peter Jones) Date: Mon, 8 Oct 2007 18:51:44 +0200 Subject: [Ferret-talk] Unified ferret_start and ferret_stop Message-ID: I would like to unify the ferret_start and ferret_stop scripts into a single script. My motivation is to make the scripts more like the other rails scripts, and to also make it fit into monitoring schemes better. I realize that some work was done recently to allow the scripts to be run from script/runner, but I think a unified script is a better approach. A unified script would allow more advanced command line processing without duplication. For example, being able to supply the RAILS_ENV on the command line, and overriding configuration options such as the PID file. Would there be any objection to me submitting patches that unified these two scripts? Here is what I would expect them to look like in the future (after my patches): script/ferretd -e production start script/ferretd -e production stop -- Posted via http://www.ruby-forum.com/. From kraemer at webit.de Tue Oct 9 03:20:19 2007 From: kraemer at webit.de (Jens Kraemer) Date: Tue, 9 Oct 2007 09:20:19 +0200 Subject: [Ferret-talk] Unified ferret_start and ferret_stop In-Reply-To: References: Message-ID: <20071009072019.GD8027@cordoba.webit.de> Hi! sounds great, just go ahead :-) cheers, Jens On Mon, Oct 08, 2007 at 06:51:44PM +0200, Peter Jones wrote: > I would like to unify the ferret_start and ferret_stop scripts into a > single script. My motivation is to make the scripts more like the other > rails scripts, and to also make it fit into monitoring schemes better. > I realize that some work was done recently to allow the scripts to be > run from script/runner, but I think a unified script is a better > approach. > > A unified script would allow more advanced command line processing > without duplication. For example, being able to supply the RAILS_ENV on > the command line, and overriding configuration options such as the PID > file. > > Would there be any objection to me submitting patches that unified these > two scripts? Here is what I would expect them to look like in the > future (after my patches): > > script/ferretd -e production start > script/ferretd -e production stop > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk > -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa From kraemer at webit.de Tue Oct 9 03:27:43 2007 From: kraemer at webit.de (Jens Kraemer) Date: Tue, 9 Oct 2007 09:27:43 +0200 Subject: [Ferret-talk] wildcard searches with german umlauts In-Reply-To: <3044da43b29cfcf68007847b07e98ef4@ruby-forum.com> References: <3044da43b29cfcf68007847b07e98ef4@ruby-forum.com> Message-ID: <20071009072743.GE8027@cordoba.webit.de> On Mon, Oct 08, 2007 at 06:15:08PM +0200, neongrau __ wrote: > i just noticed a weird problem. > > i can successfully search with full terms like > "Fl?chendesinfektionsstufen" or "Regionalan?sthesie" for example and get > correct hits. > > but when i search for those entries with wildcards > "Fl?chendesinfektion*" or "Regionalan?s*" it won't find anything > > while > "*chendesinfektionsstufen" or "*sthesie" works. > > so any wildcarded search that contains any umlauts will fail. > > anyone any idea or hint what the problem could be? I tried to reproduce this, but it worked for me: http://pastie.caboo.se/105218 yields: Fl?chendesinfektion* : 1 hit(s) Regionalan?s* : 1 hit(s) *chendesinfektionsstufen : 1 hit(s) *sthesie : 1 hit(s) Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa From schulte.eric at gmail.com Tue Oct 9 10:19:01 2007 From: schulte.eric at gmail.com (Eric Schulte) Date: Tue, 9 Oct 2007 07:19:01 -0700 Subject: [Ferret-talk] Ferret against Java Lucene index Message-ID: <18187.36309.523933.883145@gargle.gargle.HOWL> Hi, I am working on a project which has a large Lucene index in place. Can (any version of) Ferret be used against an index built using Java Lucene? Thanks, Eric From john at johnleach.co.uk Tue Oct 9 18:37:05 2007 From: john at johnleach.co.uk (John Leach) Date: Tue, 09 Oct 2007 23:37:05 +0100 Subject: [Ferret-talk] Ferret against Java Lucene index In-Reply-To: <18187.36309.523933.883145@gargle.gargle.HOWL> References: <18187.36309.523933.883145@gargle.gargle.HOWL> Message-ID: <1191969425.8659.15.camel@dogen.thepride.> Hi Eric, versions up to and including 0.9 apparently, with some conditions. And it isn't well tested either. http://ferret.davebalmain.com/trac/wiki/FAQ:Indexing#CanIuseanindexthatwasbuildwithLucene But tbh, there has been a lot of great work put into Ferret since 0.9 (now up to 0.11) it might be worth rebuilding if possible. John. -- http://www.brightbox.co.uk - UK Ruby on Rails hosting On Tue, 2007-10-09 at 07:19 -0700, Eric Schulte wrote: > Hi, > > I am working on a project which has a large Lucene index in place. Can > (any version of) Ferret be used against an index built using Java > Lucene? > > Thanks, > Eric From patrick at caring.com Wed Oct 10 15:19:17 2007 From: patrick at caring.com (Patrick Wright) Date: Wed, 10 Oct 2007 12:19:17 -0700 Subject: [Ferret-talk] Multiple index instances and ferret/acts_as_ferret Message-ID: We're running Ferret and acts_as_ferret in our production environment. We have multiple mongrels talking to a single index on a separate (virtual) server over DRb. This is working ok for now, as our index updates are fairly infrequent. I'm concerned with the lack of rendundancy/scalability in this layout. Our index won't get too big - maybe 100k indexed objects, each no more than 500 words - but it needs to be highly available, like the rest of our site (www.caring.com, if you are interested). One alternate approach I'm considering would be to do something like this: - disable the after_save callbacks in acts_as_ferret in production mode, to stop multiple mongrels writing to the index. - move all index writes to a centralized batch process which interacts with a 'master' index - periodically clone out the master index to slave indexes located locally to each user-facing rails index (not using DRb) My last company used this approach for a lucene index, with lucene running behind a custom search webapp not that different from SOLR, so the user-facing webservers retrieved search results over http from the search webapp. We had to write some fairly intricate scripting to stop and start the search webapps whilst we copied out the master index to the slaves. Does anyone have any experience with this kind of approach? Is there some standard way to distribute and run multiple instances of an index? Bonus question - how upset does a running mongrel get when the ferret index it talks to is suddenly replaced by a new set of files? Thanks for any insights on how best to solve this. Thanks, Patrick Wright From shad at liquidcultures.com Mon Oct 15 17:46:33 2007 From: shad at liquidcultures.com (Shad Reynolds) Date: Mon, 15 Oct 2007 16:46:33 -0500 Subject: [Ferret-talk] Inconsistent results between multi_search and find_by_contents (is "other" a reserved word?) Message-ID: I have a Computer type and I'm trying to query agianst it. When I do the query with find_by_contents, I get correct results. However, when I query using multi_search, I get incorrect results. I'm using the most recent version of Acts As Ferret and Ferret This returns the correct results: Computer.find_by_contents( "device_type:laptop AND os_type:other" ) This returns too many results: Computer.multi_search( "device_type:laptop AND os_type:other", [] ) Oddly, these queries are consistent when I query for os_type:windows. I feel like my use of the word "other" is throwing something off. Ideas? Thanks, Shad -- http://www.ShadReynolds.com http://www.flickr.com/photos/shadreynolds/ From jk at jkraemer.net Tue Oct 16 04:56:15 2007 From: jk at jkraemer.net (Jens Kraemer) Date: Tue, 16 Oct 2007 10:56:15 +0200 Subject: [Ferret-talk] Multiple index instances and ferret/acts_as_ferret In-Reply-To: References: Message-ID: <20071016085615.GJ18159@thunder.jkraemer.net> On Wed, Oct 10, 2007 at 12:19:17PM -0700, Patrick Wright wrote: [..] > One alternate approach I'm considering would be to do something like this: > - disable the after_save callbacks in acts_as_ferret in production mode, to > stop multiple mongrels writing to the index. > - move all index writes to a centralized batch process which interacts with > a 'master' index > - periodically clone out the master index to slave indexes located locally > to each user-facing rails index (not using DRb) should work. [..] > Does anyone have any experience with this kind of approach? Is there some > standard way to distribute and run multiple instances of an index? omdb.org uses rsync to sync index versions. > Bonus question - how upset does a running mongrel get when the ferret index > it talks to is suddenly replaced by a new set of files? Not upset at all if you do it like that: have two index directories and a symlink pointing to the one in use atm. Then sync to the currently unused index, change over the symlink and tell your mongrel to re-open it's searcher. Cheers, Jens -- Jens Kr?mer http://www.jkraemer.net/ - Blog http://www.omdb.org/ - The new free film database From bk at benjaminkrause.com Tue Oct 16 06:10:15 2007 From: bk at benjaminkrause.com (Benjamin Krause) Date: Tue, 16 Oct 2007 12:10:15 +0200 Subject: [Ferret-talk] Multiple index instances and ferret/acts_as_ferret In-Reply-To: <20071016085615.GJ18159@thunder.jkraemer.net> References: <20071016085615.GJ18159@thunder.jkraemer.net> Message-ID: > > Not upset at all if you do it like that: have two index directories > and > a symlink pointing to the one in use atm. Then sync to the currently > unused index, change over the symlink and tell your mongrel to re-open > it's searcher. as Jens said, we're doing exactly that .. take a look at the switching here: http://bugs.omdb.org/browser/branches/2007.1/lib/omdb/ferret/lib/util.rb we've also added a "last-switched" status file (0 byte with timestamp), to notify mongrel of a new index. So mongrels are using the old index unless the status file gets a newer timestamp. http://bugs.omdb.org/browser/branches/2007.1/lib/omdb/ferret/searcher.rb Ben From jk at jkraemer.net Sat Oct 20 08:31:26 2007 From: jk at jkraemer.net (Jens Kraemer) Date: Sat, 20 Oct 2007 14:31:26 +0200 Subject: [Ferret-talk] Ferret + acts_as_ferret media coverage Message-ID: <20071020123126.GW18159@thunder.jkraemer.net> Hi folks, just wanted to point you to an article about Ferret (and acts_as_ferret) in the current issue of the german iX magazine: http://www.heise.de/ix/inhalt.shtml Thanks to the authors Mathias and Ben from omdb.org :-) Cheers, Jens -- Jens Kr?mer http://www.jkraemer.net/ - Blog http://www.omdb.org/ - The new free film database From davidj503 at gmail.com Mon Oct 22 13:14:09 2007 From: davidj503 at gmail.com (David James) Date: Mon, 22 Oct 2007 13:14:09 -0400 Subject: [Ferret-talk] Unified ferret_start and ferret_stop In-Reply-To: <20071009072019.GD8027@cordoba.webit.de> References: <20071009072019.GD8027@cordoba.webit.de> Message-ID: <59b5d4330710221014w5da005a9o1b780cf803062d61@mail.gmail.com> I've tweaked the ferret server scripts a bit. Made them a little more modular. Peter, feel free to email me if you want to discuss things. Also, I'm learning about threading and forking. My tentative thought is that the use 'safefork' (a while loop encapsulating a Kernel#fork) might be able to be improved upon. The examples in The Ruby Way by Fulton seem cleaner -- they don't use Kernel#fork. Again, all of this is tentative; just thinking out loud. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20071022/9d461ad9/attachment.html From davidj503 at gmail.com Mon Oct 22 13:40:13 2007 From: davidj503 at gmail.com (David James) Date: Mon, 22 Oct 2007 13:40:13 -0400 Subject: [Ferret-talk] The ferret logs In-Reply-To: <20071005085041.GM5085@cordoba.webit.de> References: <20071005085041.GM5085@cordoba.webit.de> Message-ID: <59b5d4330710221040x11db9a2fnace6981efee33aee@mail.gmail.com> What is the exact syntax for setting the log level in ferret_server.yml? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20071022/9d3a9ffd/attachment.html From jk at jkraemer.net Mon Oct 22 17:02:07 2007 From: jk at jkraemer.net (Jens Kraemer) Date: Mon, 22 Oct 2007 23:02:07 +0200 Subject: [Ferret-talk] The ferret logs In-Reply-To: <59b5d4330710221040x11db9a2fnace6981efee33aee@mail.gmail.com> References: <20071005085041.GM5085@cordoba.webit.de> <59b5d4330710221040x11db9a2fnace6981efee33aee@mail.gmail.com> Message-ID: <20071022210207.GA4898@thunder.jkraemer.net> On Mon, Oct 22, 2007 at 01:40:13PM -0400, David James wrote: > What is the exact syntax for setting the log level in ferret_server.yml? like this: development: host: localhost port: 9010 pid_file: log/ferret.pid log_file: log/ferret_server_dev.log log_level: info debug, warn and error should also work as values. This is only present in the current trunk of acts_as_ferret for now. Jens -- Jens Kr?mer http://www.jkraemer.net/ - Blog http://www.omdb.org/ - The new free film database From julioody at gmail.com Mon Oct 22 19:03:50 2007 From: julioody at gmail.com (Julio Cesar Ody) Date: Tue, 23 Oct 2007 09:03:50 +1000 Subject: [Ferret-talk] Unified ferret_start and ferret_stop In-Reply-To: <59b5d4330710221014w5da005a9o1b780cf803062d61@mail.gmail.com> References: <20071009072019.GD8027@cordoba.webit.de> <59b5d4330710221014w5da005a9o1b780cf803062d61@mail.gmail.com> Message-ID: Can we have a look at the source? (sorry if I'm missing something and you already put it somewhere) On 10/23/07, David James wrote: > I've tweaked the ferret server scripts a bit. Made them a little more > modular. Peter, feel free to email me if you want to discuss things. > > Also, I'm learning about threading and forking. My tentative thought is > that the use 'safefork' (a while loop encapsulating a Kernel#fork) might be > able to be improved upon. The examples in The Ruby Way by Fulton seem > cleaner -- they don't use Kernel#fork. Again, all of this is tentative; > just thinking out loud. > > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk > From moming2k at gmail.com Wed Oct 24 01:16:23 2007 From: moming2k at gmail.com (=?ISO-2022-JP?B?aG9uZyBzaGluZxskQkw1TD4bKEI=?=) Date: Wed, 24 Oct 2007 13:16:23 +0800 Subject: [Ferret-talk] Question about the Fail over on the ferret server Message-ID: Dear All, Currently, I have set to using a single ferret server on a single server , and access it from several other servers that running RubyonRails on top of it. I want to ask if there is any way to setup Ferret in cluster that can prevent from single point of failure if one of the ferret server is down? Thanks. Chris Chan