New Model Objects

0 views
Skip to first unread message

Stuart

unread,
Sep 23, 2009, 8:53:03 PM9/23/09
to Thinking Sphinx
Hi,

First off thanks for a fantastic gem!

I'm having a bit of trouble when I add a new row to the table I am
trying to index, these are the steps:
1. rake ts:index
2. search and it works perfectly
3. MyModel.new ...... .save
4. rake ts:index (it shows one extra document from the previous)
5. search and the new one doesn't match
6. rake ts:rebuild
7. Search and the new object shows.

Is this behaviour intended or does anyone know a work around?

I am not using delta indexing (yet).

Cheers

Stuart

unread,
Sep 24, 2009, 6:51:25 PM9/24/09
to Thinking Sphinx
Still struggling with this, any ideas?

Cheers

James Healy

unread,
Sep 24, 2009, 9:57:03 PM9/24/09
to thinkin...@googlegroups.com
Stuart wrote:
> > I'm having a bit of trouble when I add a new row to the table I am
> > trying to index, these are the steps:
> > 1. rake ts:index
> > 2. search and it works perfectly
> > 3. MyModel.new ...... .save
> > 4. rake ts:index (it shows one extra document from the previous)
> > 5. search and the new one doesn't match
> > 6. rake ts:rebuild
> > 7. Search and the new object shows.
> >
> > Is this behaviour intended or does anyone know a work around?

The ts:rebuild task stops sphinx, rebuilds the indexes, then restarts
sphinx. It's a good sign that this works.

The ts:index task rebuilds your indexes while sphinx is still running,
then signals sphinx when finished and the new indexes are loaded.

The index task attempts to detect if sphinx is running, and only sends
the signal if it is. If it thinks sphinx isn't running, it will rebuild
the indexes, but they won't be "live" until you manually restart.

So, when you run ts:index:

- check that sphinx is actually running
- check the permissions on the sphinx pid file
(log/searchd.development.pid by default) and ensure the user running
the index rake task has permissions to read it

-- James Healy <jimmy-at-deefa-dot-com> Fri, 25 Sep 2009 11:50:31 +1000

Pat Allan

unread,
Sep 25, 2009, 3:45:04 AM9/25/09
to thinkin...@googlegroups.com
Also, what is the output of the indexing in step 4?

--
Pat
Reply all
Reply to author
Forward
0 new messages