Hi Pete It's a bit too late now, but if you see it happening again, I'm interested in the output of the indexing... maybe that had some clues as to why the indexes were (presumably) not updating.
Still, at least it's working now. Cheers -- Pat On 20/10/2010, at 2:24 PM, Pete Campbell wrote: > Well, we got it working again, though its not clear how. We rolled > back the Book.rb model and the controller to the last known working > version on production and that worked like it did before. Then we put > the latest versions back and rebuilt the indexes and everything worked > correctly. We even redeployed the entire codebase that was not working > and now it is working. > > The best explanation I can think of is that (presumably) TS was > consistently rebuilding indexes where the CONDITIONS were always > missing but now we have managed to shake it out of that mode and back > to wholesome goodness. Any ideas? Its kinda scary that this was > consistently failing until we rolled back and somehow that > (presumably) shook things up. I'm still a bit new to TS, so I could be > completely wrong also.... > > Pete > > On Oct 19, 10:18 pm, Pete Campbell <[email protected]> wrote: >> Hi Pat, no worries on the simple questions. We have reindexed & >> restarted via rake ts:rebuild several times. We're running Rails 2.2.2 >> (don't get me started), Sphinx 0.9.9, TS 1.3.16, MySQL 14.2 dist >> 5.0.22. >> >> Even the simplest query fails. This in via the console & should find >> all books that have approved = Y: >> >> $ script/console >> >>>> Book.search '', :conditions => {:approved => "Y"} >> => [] >> >> Thanks for your help! >> >> On Oct 19, 6:51 pm, Pat Allan <[email protected]> wrote: >> >> >> >>> Hi Pete >> >>> I'm going to start with the simple questions, so I apologise if you've >>> already done this: but have you re-indexed and restarted Sphinx on the >>> production server? If you've not done both since adding the fields or >>> attributes in question, then the query won't work. >> >>> Also: what versions of Sphinx, Rails and Thinking Sphinx are you using? And >>> what is the actual query you're running? >> >>> Cheers >> >>> -- >>> Pat >> >>> On 20/10/2010, at 4:14 AM, Pete Campbell wrote: >> >>>> Our dev server works perfectly on our dev server not on production. If >>>> any conditions are applied on production, there are no results >>>> returned. If I remove the CONDITIONS parameter, the rest of the search >>>> parameters are applied correctly. >> >>>> We have the same versions of TS, Sphinx & MySQL on both. The deploy >>>> strategy is different (Capistrano for dev, a script we created for >>>> prod). Unfortunately we're not getting any logfiles on prod either >>>> (not sure why yet). TS is vendored. Dev runs in the 'test' environment >>>> (orig developer didn't understand what 'test' meant). Aside from >>>> this, I can't figure out whats different between the two. Sphinx seems >>>> to have the same data & return the appropriate results (shown at >>>> bottom of this email). >> >>>> Any thoughts on where we should look for the cause of this discrepancy >>>> in behavior? >> >>>> Thanks! >> >>>> Pete >> >>>> search statement: >>>> ========================== >>>> all_books = Book.search(@search_text, >>>> :limit => MAX_SEARCH_RESULTS, >>>> :order => "promote DESC, >>>> #{SORTABLE_COLUMNS[rand(SORTABLE_COLUMNS.length)]}", >>>> :include => :books_category, >>>> :conditions => conditions, >>>> :with_all => with_all, >>>> :without => without) >> >>>> Index >>>> ========================== >>>> define_index do >>>> indexes title, :sortable => :true >>>> indexes promote, :sortable => :true >>>> indexes mod_datetime, :sortable => :true >>>> indexes publisher_id, :sortable => :true >>>> indexes description >>>> indexes bynames >>>> indexes approved >>>> indexes fiction_type >>>> indexes book_type >>>> indexes quizcreator_id >>>> has quizcreator_id >>>> has books_category.category_id , :as => :category_id >>>> where "(book_type IN ('#{Book::TYPE_READABLE}', >>>> '#{Book::TYPE_FREE}', '#{Book::TYPE_READ_ALOUD}'))" >>>> end >> >>>> Sphinx results: >>>> ========================== >> >>>> search -c config/<env>.sphinx.conf 'betty' >> >>>> displaying matches: >>>> 1. document=32, weight=2, quizcreator_id=65, sphinx_internal_id=16, >>>> class_crc=1809255439, subclass_crcs=(1809255439), sphinx_deleted=0, >>>> title_sort=402, promote_sort=1837, mod_datetime_sort=3383, >>>> publisher_id_sort=3475, quizcreator_id=3563, >>>> category_id=(3,7,11,22,28,38,69,78,97,110) >>>> id=16 >>>> title=Betty to the Rescue >>>> description=More than anything else, Betty likes to be helpful -- but >>>> somehow the helping always seems to go wrong. In this story Betty >>>> tries to rescue a poor little monkey who's stuck in a tree. >>>> book_type=R >>>> bynames=Michaela Morgan (author), Moira Kemp (illustrator) >>>> purchase_url=http://www.amazon.com/gp/redirect.html? >>>> ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct >>>> %2F1842481487%253ftag%3Damazonaffiliatedummyid%2526link%5Fcode >>>> %3Dxm2%2526camp%3D2025%2526dev-t >>>> %3D0PWN83K3NNF20R94Q6G2&tag=bigunivcom-20&linkCode=ur2&camp=178 >>>> publisher_id=1 >>>> mod_datetime=2010-10-04 01:28:36 >>>> width=930 >>>> height=639 >>>> approved=Y >>>> author_id=(NULL) >>>> promote=0 >>>> fiction_type=F >>>> quizcreator_id=091112184449 >>>> images_count=14 >>>> images_total_size=1780659 >> >>>> ...... >> >>>> -- >>>> 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 >>>> athttp://groups.google.com/group/thinking-sphinx?hl=en. > > -- > 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. > -- 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.
