> 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
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.
Radiant mailing list