Hi Josh,

Thanks for the info.  In regards to the stack trace this is what I'm  
getting

undefined method `request' for #<Advert:0x1064e3340>

/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/vendor/rails/activerecord/ 
lib/active_record/attribute_methods.rb:260:in `method_missing'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page_context.rb: 
38:in `set_process_variables'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page_context.rb: 
17:in `render_tag'
/Library/Ruby/Gems/1.8/gems/thinking-sphinx-1.2.12/lib/thinking_sphinx/ 
search.rb:102:in `collect'
/Library/Ruby/Gems/1.8/gems/thinking-sphinx-1.2.12/lib/thinking_sphinx/ 
search.rb:102:in `send'
/Library/Ruby/Gems/1.8/gems/thinking-sphinx-1.2.12/lib/thinking_sphinx/ 
search.rb:102:in `method_missing'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/lib/radiant/taggable.rb: 
33:in `send'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/lib/radiant/taggable.rb: 
33:in `render_tag'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page_context.rb: 
10:in `initialize'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page_context.rb: 
18:in `render_tag'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/lib/radiant/taggable.rb: 
33:in `send'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/lib/radiant/taggable.rb: 
33:in `render_tag'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page_context.rb: 
10:in `initialize'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page_context.rb: 
18:in `render_tag'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page_context.rb: 
18:in `render_tag'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/lib/radiant/taggable.rb: 
33:in `send'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/lib/radiant/taggable.rb: 
33:in `render_tag'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page_context.rb: 
10:in `initialize'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page_context.rb: 
18:in `render_tag'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page.rb:287:in  
`parse'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page.rb:292:in  
`parse_object'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page.rb:142:in  
`render_snippet'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/standard_tags.rb: 
374:in `tag:content'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/lib/radiant/taggable.rb: 
33:in `send'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/lib/radiant/taggable.rb: 
33:in `render_tag'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page_context.rb: 
10:in `initialize'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page_context.rb: 
18:in `render_tag'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page.rb:287:in  
`parse'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page.rb:292:in  
`parse_object'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page.rb:126:in  
`render'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/models/page.rb:116:in  
`process_without_mailer'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/controllers/ 
site_controller.rb:46:in `process_page'
/Library/Ruby/Gems/1.8/gems/radiant-0.8.0/app/controllers/ 
site_controller.rb:20:in `show_page'

Thanks

John
On 30 Oct 2009, at 13:59, Josh French wrote:

>> This works fine as all the news gets indexed, however I'm struggling
>> to search the news article.  When I do a search terms that has
>> NewsArticles in it I get the following error message
>
> Hi John,
>
> The Sphinx Search extension was initially built to work with arbitrary
> models but the actual results page is a late addition and so may need
> some tweaking. Can you paste a little more of the stack trace where
> you're getting the "undefined method `request'" error? I suspect it's
> just that the results tags are expecting Page objects and your
> NewsArticle pages don't conform to some assumption. (I am assuming
> that NewsArticle is *not* a Page subclass -- is that correct?)
>
>> does it mean that the tags are being
>> indexed and as such and class or id attributes etc might appear
>
> I *think* the strip_html option operates before your content gets
> indexed, but you might want to verify that with the Sphinx folks.
>
>> One final question, there doesn't appear to be a link tag in the
>> extension's tag class.  Do I need to write my own 'link' tag to link
>> to the correct page?
>
> In your case, you'll need to because you have polymorphic results
> objects. There's no way of knowing if your models have methods like
> link, url, or slug, so I can't supply tags that automatically expose
> the proper links.
>
> In the simple case however -- a search that returns Page objects only
> -- within an r:results:each block you should be able to call any tag  
> that a Page responds to, like r:url or r:title.
>
> Josh
> _______________________________________________
> Radiant mailing list
> Post:   Radiant@radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to