In trying to isolate this down to something thats not particular to my
environment, I found a more serious (related?) issue that also shows a
difference between OSX/Linux.  I created a simple rails (2.2.2) app,
setup fixtures, etc, which you can download here:
https://s3.amazonaws.com/sml_public/sphinx.tgz

Take a look at and run prepare.sh which will create mysql db, load
fixtures, start sphinx, then run a couple of TS searches.  Under OSX,
it works as expected, under linux (ubuntu 9.04), it doesn't.
Specifically, I do one search with a ":with => {:status => [3, 4]}"
for data that has status as 3, it shows up correctly, I change the
status, save it, delta index, rerun the search, and the data still
shows up, but only on linux.  Interestingly enough, running a second
delta index (or a full index) on linux clears up the problem.  Any
ideas?


On May 23, 12:41 am, Pat Allan <[email protected]> wrote:
> Matt, what's the contents of your define_index block for your model?  
> It seems like Sphinx can access the results, but ActiveRecord can't...
>
> Also, in your test, you're using some custom methods: search,  
> delta_index_search, etc. Can you put those in a gist or pastie so I  
> can see how you're searching for the expected results?
>
> --
> Pat
>
> On 22/05/2009, at 8:51 PM, matt wrote:
>
>
>
> > Thanks for the reply, but this isn't the solution this time.  My path
> > is actually the same on both systems (installed sphinx from tarball on
> > mac), and is in the PATH on both, so both OSX/Linux are able to find
> > the binaries correctly.  All my other tests pass, and doing a full
> > index gives the right behavior (empty response set), but doing a delta
> > index on OSX gives me a single nil response for the search instead of
> > no responses.  Does anyone know what th right behavior is?  Should I
> > be getting an empty response set, or should I be getting a respnse set
> > containing nil?
>
> > Matt
>
> > On May 20, 5:26 pm, Thuva Tharma <[email protected]> wrote:
> >> I had a similar problem with delta indexing. I develop on Mac OS X  
> >> and
> >> deploy on Ubuntu. The problem was that the path to sphinx binaries
> >> were different in both systems.
>
> >> In Mac OS X, the path is /opt/local/bin (I used Macports to install
> >> Sphinx). In Ubuntu, the path is /usr/local/bin.
>
> >> Setting the bin_path appropriately in config/sphinx.yml solved the
> >> issue. Here is how my sphinx.yml file looks like:
>
> >> development:
> >>   bin_path: /opt/local/bin
>
> >> production:
> >>   bin_path: /usr/local/bin
>
> >> I hope that would fix your problem.
>
> >> -- Thuva Tharma
>
> >> On May 20, 12:35 pm, matt <[email protected]> wrote:
>
> >>> I have TS all setup and working correctly.  I also have a suite of
> >>> integration tests that test my assumptions about how sphinx  
> >>> works.  On
> >>> OS X, these integration tests succeed, but on our CI server (ubuntu
> >>> linux), they fail.  The difference being in how delta indexes get
> >>> treated.  Basically, the my test (see below) is verifying that  
> >>> changes
> >>> don't show up in the search until after a delta index is run.  On  
> >>> OSX,
> >>> the behavior seems to be that post destroy _and_ delta, the result  
> >>> set
> >>> has one item that is nil, while on linux, the result set has no
> >>> items.  The linux variant seems to be the correct one, and thats  
> >>> what
> >>> we deploy to, so I'll change my test to match, but I'd like to be  
> >>> able
> >>> to have successful tests on OSX as well.
>
> >>> I'm not sure how to debug this further. Searchd itself is logging as
> >>> below on OSX when I run the test.  Note that it is returning a count
> >>> of (1) for the second to last request.  On linux this value is 0:
>
> >>> [Wed May 20 12:30:47.584 2009] 0.025 sec [all/5/rel 0 (0,20)] [*]
> >>> deltapicture
> >>> [Wed May 20 12:30:47.725 2009] 0.000 sec [all/5/rel 0 (0,20)] [*]
> >>> deltapicture
> >>> [Wed May 20 12:30:49.482 2009] 0.023 sec [all/5/rel 1 (0,20)] [*]
> >>> deltapicture
> >>> [Wed May 20 12:30:49.560 2009] 0.000 sec [all/5/rel 1 (0,20)] [*]
> >>> deltapicture
> >>> [Wed May 20 12:30:51.235 2009] 0.000 sec [all/5/rel 1 (0,20)] [*]
> >>> deltapicture
> >>> [Wed May 20 12:30:52.977 2009] 0.001 sec [all/5/rel 0 (0,20)] [*]
> >>> deltapicture
>
> >>>   def test_delta_indexing
> >>>     title = "deltapicture"
> >>>     assert_equal 0, search(Picture, title).size
> >>>     pic = create_picture(:title => title)
> >>>     assert_equal 0, search(Picture, title).size
>
> >>>     self.class.delta_index_search
>
> >>>     results = search(Picture, title)
> >>>     assert_equal 1, results.size
> >>>     assert_equal pic.id, results.first.id
>
> >>>     pic.destroy
> >>>     results = search(Picture, title)
> >>>     assert_equal 1, results.size
> >>>     assert_nil results.first
>
> >>>     self.class.delta_index_search
>
> >>>     results = search(Picture, title)
> >>>     assert_equal 1, results.size
> >>>     assert_nil results.first
>
> >>>     self.class.index_search
>
> >>>     assert_equal 0, search(Picture, title).size
> >>>   end
--~--~---------~--~----~------------~-------~--~----~
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