Hmm, need to think through this still, but one question that I've thought of now: Are you seeing output from the Sphinx indexer tool when you make changes that should fire the delta index?
-- Pat On 26/12/2008, at 11:34 PM, Jörg Battermann wrote: > > Pat, > > yep I saw that this group is moderated AFTER I tried a couple times ;) > Sorry about that. > > regarding the problem: well I've narrowed it down to this strange > situation: > > Whenever I update a model by hand in the console, do a model.save the > delta attribute gets set to true and I immediately see the sphinx > output regarding the inclusion in the delta index and the model does > show up entirely perfectly in each search-results thereafter. > > > Now doing the same through the controller/view perspective.. it does > not work and I really don't know why. Basically I have 2 models and > corresponding controllers which I update by e.g. > @user.update_attributes(params[:user]) (mass-assigning is bad I know, > but I'll change to proper per attribute updates once the attribute > changes have settled).... and then the .delta attribute -does- get set > to true, but in searches this instance does no longer appear at all... > only after the next complete re-index it does. > > I've tried explicitly .save 'ing after the update_attributes above... > didn't change. Tried fiddling with manual delta-indexing calling the > TS.methods for that directly.. no change. I stopped sphinx, deleted > the index, re-configured, indexed, started... no change in that > behaviour. > > It can't really be development-mode related, right? Or any sort of > dirty objects/attributes related that ts doesn't pick it up? I am > using passenger locally.. with the dev env.. are there maybe any > quirks known with that? Hrm.. besides that it's really nothing out of > the ordinary... tried uncommenting all other before/after_save/ > validate callbacks just to make sure there aren't any weird things > going on.. but no change either. > > Is there anything else I can do to narrow this down? Should these > sphinx-delta-index messages that appear in the console after > instance.save also appear in the dev-log when doing via the > controller/ > view way? > > Rails is 2.2.2, ruby 1.8.7, ts via normal git submodules... just > checked.. have the latest version. > > I am kind of lost here :) > > Cheers, > -J > > On Dec 26, 3:55 pm, Pat Allan <[email protected]> wrote: >> Hi Jörg >> >> The reason your post didn't appear straight away is because there's >> moderation for everyone's first posts here (to avoid spam). Sorry for >> the delay in getting it approved. >> >> As for your delta issue - it doesn't look like you're doing anything >> wrong. Can you confirm you've restarted Sphinx (and re-indexed >> inbetween stopping and starting) after adding the delta property? I'm >> expecting you have though, which may mean the problem is how Sphinx >> treats separate indexes. >> >> If the latter is the case, I can't offer much in the way of >> solutions, >> except that I'm hoping to have a fix soon - Sphinx can merge indexes, >> and so I want to get TS to a point where after running a delta index >> it merges the results back into the core index (and so it gets >> treated >> all as a single dataset again). >> >> Unfortunately, I'm not sure when I can get a solution done though (a >> common statement of mine on this list, sadly). Hoping to have more >> time to tackle TS improvements over the next month though. >> >> One other caveat - it takes Sphinx a second (maximum, although I >> guess >> that would depend on local index sizes, etc) to catch up with the new >> values in delta indexes - but I'm guessing there's a slight delay >> between making your new instance and testing the search, so I doubt >> that's the problem. >> >> Cheers >> >> -- >> Pat >> >> On 26/12/2008, at 1:31 AM, Jörg Battermann wrote: >> >> >> >> >> >>> Hey there, >> >>> I am pretty sure I am doing something wrong, but for some reason new >>> entries/instances of a model which has the delta-index declaration >>> included do not show up in a generic, empty ("") search on that >>> model... >> >>> The ts declaration is like that: >> >>> define_index do >>> indexes title, :sortable => true >>> indexes cached_plaintext_question, :as => :question >>> indexes answers.cached_plaintext_body, :as => :answers >>> indexes cached_tag_list, :as => :tags >>> indexes user.name, :as => :user >>> indexes answered_by, user_id >> >>> has created_at >>> has answers(:id), :as => :answer_ids >>> set_property :delta => true >>> end >> >>> Now after creating a new new question (that's the model that's being >>> indexed/searched), and going back to the controller's index, which >>> has >>> the following search code: >> >>> @search_options = { >>> :page => (params[:page] || 1), >>> :per_page => Question.per_page, >>> :include => :user, >>> :order => "created_at DESC", >>> :match_mode => :extended >>> } >> >>> @questions = Question.search((params[:search] || ""), >>> @search_options) >> >>> .... @questions does not contain this new instance mentioned above, >>> but does after a full (re-)index. >> >>> Why's that? >> >>> Cheers, thanks & merry x-mas to everyone :) >>> -Jörg > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
