Following this guide, I have the server set up and indexing appears to be
working mostly. (I am getting an error about the word 'set' as an attribute,
and I'm not sure why it's happening since I don't define that in any of my
indexes.)
But my results page heavily relies on excerpts, and I can't seem to get the
new-style system to work.
I tried first with the first technique listed on the Excerpts page in the
manual, and I am getting this result:
undefined method `panes' for #<ThinkingSphinx::Search::Context:0x007fc3a2740848>
I did not try the second approach yet, because I am not sure how I can do that
in my multi-model search results controller. (I don't have a single model to
search within, so I don't see how I could define the Excerpter as you describe
in the manual.)
Here's what you have for that:
@excerpter = ThinkingSphinx::Excerpter.new 'article_core',
But in my application, I am searching across title_core, page_core, and
person_core in one go.
Is there a model-agnostic way to excerpt in TS 3.x?
Here's just one of the methods (the simplest, I hope) from my search controller:
class SearchController < ApplicationController
def results
@results = ThinkingSphinx.search Riddle.escape(params[:q].to_s),
:page => params[:page],
:match_mode => :phrase,
:excerpt_options => {
:exact_phrase => true,
:limit => 2000,
:around => 20,
:force_all_words => true,
:chunk_separator => '</li><li>'
}
@hits = @results.total_entries rescue 0
@results.context.panes << ThinkingSphinx::Panes::ExcerptsPane
end
# ...
end
This blows up with the aforementioned error. Can you see what might be going
wrong here?
On Dec 28, 2014, at 8:10 PM, Pat Allan <[email protected]> wrote:
> If there’s anything you come across that isn’t obvious with how to upgrade
> it, do let me know.
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.