OK it's "fixed". Well, everything works, but I don't know why.

I can run the app, search, change the schema, rebuild, rerun searches
with the new indexing. I have bounced mongrel, and tortured the
environment in other ways, and it works.

Here is what I did to "fix" the problem.

1. Switched to the plugin
     Originally, I had installed ts 1.2.8 as a gem.  Since I couldn't
make it work, I failed back to 1.2.7 as a gem.
     Still couldn't make it work, so uninstalled the gem and installed
the plugin (1.2.8)
2.  I have to run everything as root.
     None of the ts commands work unless I do.  I have a feeling this
is the root of the problem (pun intended), and am a bit worried it's
not set up right.
3.  Lowered the privileges on the db connection
(database.yml   ...development server now connects with "less than
root" username)
     I did this as a stab in the dark, since the first error I got
trying to run ts:index, it complained that it couldn't connect to the
db
     (and database.yml connection was configured as 'root').  I
lowered the db connection reqs in the hopes that I could run the ts
commands not as root.

Where can I get the definitive word on what privileges each component
is supposed to run as?  (rake tasks, searchd, indexer, etc).

Thanks!  (Happy again, sort of).

On Aug 25, 5:41 pm, monhegan <[email protected]> wrote:
> More likely, compatibility problem btwn me & the aforementioned gems.
>
> Installed will_paginate 2.3.11, and got it working. Installed sphinx &
> ts (1.2.8), got them working (or so I thought).  As soon as I changed
> my model, and ran a ts:rebuild, suddenly am getting the following err
> (from the server log):
>
> "NoMethodError (undefined method `define_index' for #<Class:
> 0x26c56e0>):
>   /Users/mo/.gem/ruby/1.8/gems/mislav-will_paginate-2.3.11/lib/
> will_paginate/finder.rb:168:in `method_missing'
>   app/models/plant.rb:55
>   app/controllers/welcome_controller.rb:3:in `index' "
>
> Get the same err if I fire up the console, and do a simple finder
> call:
>
> >> all = Plant.find(:all)
>
> or...
>
> >> one = Plant.first
>
> Seems suddenly that will_paginate does not like the "define_index"
> call in my (plant.rb) model.  Here it is the call:
>
>   define_index do
>     indexes binomial, :sortable => true
>     indexes family, :sortable => true
>     indexes bloom_season
>     indexes wildlife_attracted
>     indexes notes
>     indexes common_names(:name), :as => :common_name, :sortable =>
> true
>   end
>
> Note that the associations are all defined above define_index.   I
> also tried substituting stopping ts, creating the index, and
> restarting ts, instead of calling :rebuild.  Both approaches seem to
> give the right feedback:
>
> $ sudo rake ts:rebuild
> (in /Users/mo/development/ruby/nativegardening)
> Sphinx 0.9.8.1-release (r1533)
> Copyright (c) 2001-2008, Andrew Aksyonoff
>
> using config file '/Users/mo/development/ruby/nativegardening/config/
> development.sphinx.conf'...
> stop: succesfully sent SIGTERM to pid 7880
> Stopped search daemon (pid 7880).
> Generating Configuration to /Users/mo/development/ruby/nativegardening/
> config/development.sphinx.conf
> Sphinx 0.9.8.1-release (r1533)
> Copyright (c) 2001-2008, Andrew Aksyonoff
>
> using config file '/Users/mo/development/ruby/nativegardening/config/
> development.sphinx.conf'...
> indexing index 'plant_core'...
> collected 307 docs, 0.0 MB
> collected 0 attr values
> sorted 0.0 Mvalues, 100.0% done
> sorted 0.0 Mhits, 100.0% done
> total 307 docs, 26226 bytes
> total 0.038 sec, 685736.69 bytes/sec, 8027.19 docs/sec
> distributed index 'plant' can not be directly indexed; skipping.
> Sphinx 0.9.8.1-release (r1533)
> Copyright (c) 2001-2008, Andrew Aksyonoff
>
> using config file '/Users/mo/development/ruby/nativegardening/config/
> development.sphinx.conf'...
> creating server socket on 127.0.0.1:3312
> Started successfully (pid 7984).
>
> Any ideas?
>
> PS    ...commenting out the "define_index" call in the model of course
> makes the problem go away, but that's obviously not a solution.  I had
> this all working for the first session... it was properly searching in
> the db!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to