Ah, great research... just one more question, then I can really dig  
into solving it, hopefully this week: what version of Rails are you  
running?

-- 
Pat

On 05/08/2009, at 3:57 PM, Martijn wrote:

>
> Done it. Still doesn't work :( I've figured out some of its behavior
> though...
>
> After a deploy (and running rake RAILS_ENV=staging ts:config ; rake
> RAILS_ENV=staging ts:stop ; rake RAILS_ENV=staging ts:index ; rake
> RAILS_ENV=staging ts:start) I go to the console.
>
> ThinkingSphinx.indexed_models.inspect returns []
> Page.search ' ' returns results (yes!!)
> ThinkingSphinx.indexed_models.inspect then returns ['Page']
> Item.search ' ' gives the error (NoMethodError: undefined method
> `constantize' for nil:NilClass)
> ThinkingSphinx.indexed_models.inspect then returns ['Page','Item']
> Page.search ' ' keeps returning results, but Item.search ' ' keeps
> giving the error.
>
> Hopefully this is a useful clue? Running
> 'ThinkingSphinx.indexed_models.inspect' for the first time in
> development returns ['Page', 'Post', 'Item'] immediately.
>
> Martijn
>
> On Aug 5, 3:42 pm, Pat Allan <[email protected]> wrote:
>> It's odd, indeed. The only difference I can see in your indexes is
>> that Item doesn't use associations, but the other two do. Can you
>> remove the associations fields and attributes (and add a placeholder
>> field for Page, because at least one is needed - indexes  
>> "'text'", :as
>> => :text) and see if that changes anything?
>>
>> --
>> Pat
>>
>> On 05/08/2009, at 2:36 PM, Martijn wrote:
>>
>>
>>
>>> When I put 'puts ThinkingSphinx.indexed_models.inspect' inside the  
>>> def
>>> models_by_crc in configuration.rb, it returns every model at
>>> development - ["Item", "Page", "Post"] and only one model at  
>>> staging -
>>> ["Item"]. (The search only works for Items in this case ...)
>>
>>> So I guess the million pancake question is: why doesn't it display  
>>> all
>>> the models? I don't get any strange output when running 'rake ts:in
>>> RAILS_ENV=staging'
>>
>>> Martijn
>>
>>> On Aug 5, 2:52 pm, Pat Allan <[email protected]> wrote:
>>>> Hi Martijn
>>
>>>> Thanks for the update with the latest stack trace. It's odd that  
>>>> it's
>>>> one model in particular that's having problems. Can you share your
>>>> define_index blocks for each model?
>>
>>>> --
>>>> Pat
>>
>>>> On 05/08/2009, at 1:10 PM, Martijn wrote:
>>
>>>>> Hi Pat,
>>
>>>>> Thanks for the reply. I've updated to the latest version of TS  
>>>>> now.
>>>>> The error stays though...
>>
>>>>> Querying Sphinx: lorem
>>
>>>>> ActionView::TemplateError (undefined method `constantize' for
>>>>> nil:NilClass) on line #8 of projects/search.html.erb:
>>
>>>>> 8:       <%- @contributions.each do |contribution| %>
>>>>> ...
>>>>>    vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:
>>>>> 615:in `class_from_crc'
>>>>>    vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:
>>>>> 601:in `instances_from_matches'
>>>>>    vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:
>>>>> 599:in `each'
>>>>>    vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:
>>>>> 599:in `instances_from_matches'
>>>>>    vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:
>>>>> 219:in `populate'
>>>>>    vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:
>>>>> 284:in `call'
>>>>>    vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:
>>>>> 284:in `retry_on_stale_index'
>>>>>    vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:
>>>>> 205:in `populate'
>>>>>    vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:
>>>>> 78:in
>>>>> `method_missing'
>>
>>>>> The strange thing is, I search over 3 models; Post, Page and  
>>>>> Item. I
>>>>> only get this error when I search for text that appears in a Post.
>>>>> It
>>>>> only happens at staging as well - on my development machine
>>>>> everything
>>>>> works.
>>
>>>>> regards,
>>>>> Martijn
>>
>>>>> On Aug 4, 9:41 pm, Pat Allan <[email protected]> wrote:
>>>>>> Hi Martijn
>>
>>>>>> Not entirely sure why this is happening - but it appears you're
>>>>>> using
>>>>>> an old version of TS, so that makes it a bit hard to debug. Would
>>>>>> you
>>>>>> be able to update to the latest and try again?
>>
>>>>>> Also, I've deprecated ThinkingSphinx::Search.search for
>>>>>> ThinkingSphinx.search in recent versions (1.2.x) - although the  
>>>>>> old
>>>>>> syntax still works.
>>
>>>>>> Cheers
>>
>>>>>> --
>>>>>> Pat
>>
>>>>>> On 04/08/2009, at 4:38 PM, Martijn wrote:
>>
>>>>>>> Hi all,
>>
>>>>>>> On my staging environment, I want to search over multiple  
>>>>>>> models.
>>>>>>> If I
>>>>>>> search models individually, everything works fine. However, if I
>>>>>>> search using ThinkingSphinx::Search.search 'something' - I get  
>>>>>>> the
>>>>>>> following error:
>>
>>>>>>> NoMethodError (undefined method `constantize' for nil:NilClass):
>>>>>>>    /vendor/plugins/thinking-sphinx/lib/thinking_sphinx/
>>>>>>> collection.rb:
>>>>>>> 101:in `class_from_crc'
>>>>>>>    /vendor/plugins/thinking-sphinx/lib/thinking_sphinx/
>>>>>>> collection.rb:
>>>>>>> 80:in `instances_from_classes'
>>>>>>>    /vendor/plugins/thinking-sphinx/lib/thinking_sphinx/
>>>>>>> collection.rb:
>>>>>>> 78:in `each'
>>>>>>>    /vendor/plugins/thinking-sphinx/lib/thinking_sphinx/
>>>>>>> collection.rb:
>>>>>>> 78:in `instances_from_classes'
>>>>>>>    /vendor/plugins/thinking-sphinx/lib/thinking_sphinx/
>>>>>>> collection.rb:
>>>>>>> 39:in `instances_from_matches'
>>>>>>>    /vendor/plugins/thinking-sphinx/lib/thinking_sphinx/
>>>>>>> collection.rb:
>>>>>>> 31:in `create_from_results'
>>>>>>>    /vendor/plugins/thinking-sphinx/lib/thinking_sphinx/ 
>>>>>>> search.rb:
>>>>>>> 371:in `search'
>>>>>>>    /vendor/plugins/thinking-sphinx/lib/thinking_sphinx/ 
>>>>>>> search.rb:
>>>>>>> 388:in `call'
>>>>>>>    /vendor/plugins/thinking-sphinx/lib/thinking_sphinx/ 
>>>>>>> search.rb:
>>>>>>> 388:in `retry_search_on_stale_index'
>>>>>>>    /vendor/plugins/thinking-sphinx/lib/thinking_sphinx/ 
>>>>>>> search.rb:
>>>>>>> 363:in `search'
>>
>>>>>>> Everything works on development though. Why do I get this  
>>>>>>> error on
>>>>>>> staging? Help is greatly appreciated!
> >


--~--~---------~--~----~------------~-------~--~----~
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