Unfortunately, upgrading TS fixed it for development mode, but pushing
out to production (a linux box) didn't save me. I've changed my
capistrano script so that the index files are now all owned by my
runner user ('annot') instead of my user. My index looks like this:
define_index do
# dog
indexes state
indexes breed
indexes call_name
indexes registered_name
indexes registration
has born_on
indexes collaborator
indexes coat_color
indexes gender
indexes(:id, :as => :dog_id)
indexes broad_number
indexes collaborator_number
indexes [broad_number, collaborator_number],
:as => :identifier
indexes notes
indexes related_dogs_health
has created_at, :sortable => true
# owner
indexes [owners.first_name, owners.middle_name,
owners.last_name], :as => :owner_name
indexes [owners.address1, owners.address2, owners.city,
owners.state, owners.postal_code, owners.country], :as
=> :owner_address
indexes owners.state, :as => :owner_state
indexes owners.phone, :as => :owner_phone
indexes owners.mobile_phone, :as => :owner_mobile_phone
indexes owners.email, :as => :owner_email
# vet
indexes [vet.first_name, vet.middle_name,
vet.last_name], :as => :owner_name
indexes [vet.address1, vet.address2, vet.city,
vet.state, vet.postal_code, vet.country], :as => :owner_address
indexes vet.phone, :as => :owner_phone
indexes vet.mobile_phone, :as => :owner_mobile_phone
indexes vet.email, :as => :owner_email
# diseases
indexes diseases(:name), :as => :disease_name
# samples
indexes samples.lsid, :as => :sample_lsid
indexes samples.freezer_address, :as => :sample_freezer_address
set_property :delta => true
end
My sphinx.yml looks like this:
production:
enable_star: 1
min_prefix_len: 1
min_infix_len: nil
bin_path: '/seq/annotation/development/tools/sphinx/0.9.8.1/bin'
Im going to end up doing infix searching, not prefix, but the index
generates faster this way.
Yes, in development mode everything is fine, as is the production
environment on my development machine. I'm using mysql 5.0.20 in
production, and it's a linux machine. I'm developing locally on a
mac. If there are errors accessing the index from the production
website, they should show up in production.log, right?
Here's a new facet - Running script/console on my production server
using my prod environment, everything works correctly - the delta
index is updated. Once I modify a dog in script/console, the delta'd
dog starts showing up in search results again. To me, this says that
the web server is reading the delta index just fine, but is having
trouble either modifying the index or rotating the index. Where would
be a good place to look at these things?
Andrew
On Apr 20, 9:23 am, Pat Allan <[email protected]> wrote:
> Hi Andrew
>
> Not sure what the cause is at the moment, but let's start with the
> following:
> * What's your define_index block for Dog?
> * Do you have anything in config/sphinx.yml?
> * Just to confirm (although you've implied it), everything's fine in
> development mode?
> * What database are you using? And are you running on Windows or a
> *nix system for your development machine? (Let's keep the focus there,
> so if we fix that, we can try the same thing on the production machine)
>
> Cheers
>
> --
> Pat
>
> On 20/04/2009, at 10:43 AM, Andrew wrote:
>
>
>
> > I feel somewhat confident that both the search daemon and the site are
> > running as the same user. Interestingly, I fired up script/server and
> > searchd (via rake ts:run) using RAILS_ENV = production in my local
> > development environment (regenerated indices first) and replicated the
> > issue. Should I be looking for differences between
> > development.sphinx.conf and production.sphinx.conf? A quick diff
> > didn't show anything interesting, but I can keep barking up that tree.
>
> > On Apr 17, 8:28 pm, Ryan Bigg <[email protected]> wrote:
> >> Who are you running the search daemon as and who are you running the
> >> site as? I had an issue where I was running the daemon as root and
> >> the
> >> site as a user called "store". Store didn't have permissions to
> >> access
> >> root's indexes so when I edited records they were magically
> >> disappearing. You may have the same issue.
>
> >> -----
> >> Ryan Bigg
> >> Mocra - Premier iPhone and Ruby on Rails Consultants
> >> w -http://mocra.com
> >> e - [email protected]
> >> p - +61 432 937 289 or +61 7 3102 3237
> >> skype - radarlistener
>
> >> On 18/04/2009, at 6:25 AM, Andrew wrote:
>
> >>> Hello,
>
> >>> I've been having some difficulties with thinking_sphinx and delta
> >>> indexing on my production server. Everything works fine in test,
> >>> and
> >>> I've been hammering at this all day and not gotten to a solution. I
> >>> first attempted to solve this with a bin_path in my config/
> >>> sphinx.yml,
> >>> so I put that in, and then I had to mess with a bunch of issues
> >>> regarding user permissions, but now even though everything seems
> >>> to be
> >>> working (the logs don't show any errors anywhere), when I save my
> >>> indexed model, it stops showing up in search results (because
> >>> delta is
> >>> set to true). I am using simple delta functionality, (set :delta =>
> >>> true in my index), and when I save my model, I get these two line-
> >>> pairs in searchd.log:
>
> >>> [Fri Apr 17 16:18:11.869 2009] [ 7128] rotating indices (seamless=1)
> >>> [Fri Apr 17 16:18:11.869 2009] [ 7128] rotating finished
> >>> [Fri Apr 17 16:18:12.240 2009] [ 7128] rotating indices (seamless=1)
> >>> [Fri Apr 17 16:18:12.240 2009] [ 7128] rotating finished
>
> >>> I think that's the main index and the delta index being rotated,
> >>> but I
> >>> can't tell. Production log looks like this between my edit and
> >>> update
> >>> actions:
>
> >>> Sphinx 0.9.8.1-release (r1533)
> >>> Copyright (c) 2001-2008, Andrew Aksyonoff
>
> >>> using config file '/seq/annotation/kennel/releases/20090417164316/
> >>> config/production.sphinx.conf'...
> >>> indexing index 'dog_delta'...
> >>> collected 3 docs, 0.0 MB
> >>> collected 0 attr values
> >>> sorted 0.0 Mvalues, 100.0% done
> >>> sorted 0.0 Mhits, 94.3% done
> >>> total 3 docs, 183 bytes
> >>> total 0.435 sec, 420.80 bytes/sec, 6.90 docs/sec
> >>> rotating indices: succesfully sent SIGHUP to searchd (pid=7128).
> >>> Sphinx 0.9.8.1-release (r1533)
> >>> Copyright (c) 2001-2008, Andrew Aksyonoff
>
> >>> using config file '/seq/annotation/kennel/releases/20090417164316/
> >>> config/production.sphinx.conf'...
> >>> indexing index 'dog_delta'...
> >>> collected 3 docs, 0.0 MB
> >>> collected 0 attr values
> >>> sorted 0.0 Mvalues, 100.0% done
> >>> sorted 0.0 Mhits, 94.0% done
> >>> total 3 docs, 181 bytes
> >>> total 0.298 sec, 607.20 bytes/sec, 10.06 docs/sec
> >>> rotating indices: succesfully sent SIGHUP to searchd (pid=7128).
>
> >>> I'm using rails 2.1.1, sphinx 0.9.8.1, and thinking_sphinx 0.9.5.
>
> >>> Does anyone have an idea for what the matter is with my deltas?
> >>> Everything in development works fine, which leads me to suspect it's
> >>> an environment thing, but frankly I'm running out of things to
> >>> check.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---