I can see excerpts method now, but it still does work with UTF-8 characters.

rs = VersePl.search('pozdrawia && łukasz')
rs.context[:panes] << ThinkingSphinx::Panes::ExcerptsPane
puts rs.first.text # that's correct:
# => Pozdrawia was Łukasz, lekarz miły i Demas.

puts rs.first.excerpts.text
<span class="match">Pozdrawia</span> was Šukasz, lekarz miły i Demas.

It matches only non-UTF-8 words and all UTF-8 characters are corrupted.

--
JZ

On Saturday, March 30, 2013 11:53:27 PM UTC, Pat Allan wrote:
>
> That's a bug - and I've just fixed it now. If you use the following in 
> your Gemfile, it should work fine:
>
>   gem 'thinking-sphinx', '~> 3.0.2',
>     :git => 'git://github.com/pat/thinking-sphinx.git',
>     :ref => 'b50e7d3f4c'
>
> -- 
> Pat
>
> On 31/03/2013, at 10:44 AM, hipertracker wrote:
>
> > But when I repeat that with a1 different phrase I have a side effect. 
> search.context[:panes] array is groving with every new search. Is it 
> intentional or an error?
> > 
> > search = MyModel.search 'phrase2'
> > search.context[:panes] << ThinkingSphinx::Panes::ExcerptsPane
> > p search.context[:panes] 
> > # => [ThinkingSphinx::Panes::ExcerptsPane, 
> ThinkingSphinx::Panes::ExcerptsPane]
> > search = MyModel.search 'phrase3'
> > search.context[:panes] << ThinkingSphinx::Panes::ExcerptsPane
> > p search.context[:panes] 
> > # => [ThinkingSphinx::Panes::ExcerptsPane, 
> ThinkingSphinx::Panes::ExcerptsPane, ThinkingSphinx::Panes::ExcerptsPane]
> > 
> > --
> > JZ
> > 
> > On Saturday, March 30, 2013 2:46:09 AM UTC, Pat Allan wrote:
> > I've actually been working on updating documentation for TS v3 over the 
> last 24 hours… though the changes are not online yet (as they're not 
> complete).
> > The excerpts method isn't added to search results by default, but it's 
> easily enabled:
> > 
> >   search = MyModel.search 'phrase'
> >   search.context[:panes] << ThinkingSphinx::Panes::ExcerptsPane
> >   search.first.excerpts
> > 
> > Cheers
> > 
> > -- 
> > Pat
> > 
> > On 30/03/2013, at 1:39 PM, hipertracker wrote:
> > 
> > > How to use excerpts in TS3? http://pat.github.com/ts/en/excerpts.htmlis 
> > > old and does not work in newer TS3.
> > > 
> > > Thinking Sphinx 2.0.11:
> > > 
> > > MyModel.search('phrase').first.excerpts 
> > > # => #<ThinkingSphinx::Excerpter:0x3fd79290348c>
> > > 
> > > Thinking Sphinx 3.0.2:
> > > 
> > > MyModel.search('phrase').first.excerpts
> > > NoMethodError: undefined method `excerpts' for 
> #<Verse:0x007fa5dde723d8>
> > > 
> > > --
> > > JZ
> > > 
> > > -- 
> > > 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?hl=en.
> > > For more options, visit https://groups.google.com/groups/opt_out.
> > >  
> > >  
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > 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] <javascript:>.
> > To post to this group, send email to 
> > [email protected]<javascript:>
> .
> > Visit this group at http://groups.google.com/group/thinking-sphinx?hl=en
> .
> > For more options, visit https://groups.google.com/groups/opt_out.
> >  
> >  
>
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to