Has the Excerpt option changed?

5 views
Skip to first unread message

Walter Lee Davis

unread,
Feb 28, 2019, 11:34:04 PM2/28/19
to thinkin...@googlegroups.com
I am using TS again after many years, and so I have installed the latest Sphinx 3 and the latest TS 4.1.0 with my Rails 5.1.6.1 project. I am getting an odd response from Sphinx when I search:

Sphinx Unexpected search options: [:excerpts]

This is happening on Mac OS in development mode.

Here is my controller method:

@results = ThinkingSphinx.search(ThinkingSphinx::Query.escape(params[:q]), :excerpts => {
:limit => 1000,
:around => 40,
:force_all_words => true,
:chunk_separator => ' … '
})
@results.context[:panes] << ThinkingSphinx::Panes::ExcerptsPane

And here is the index:

# frozen_string_literal: true

ThinkingSphinx::Index.define :document, :with => :active_record do
where sanitize_sql(["published", true])

indexes title
indexes teaser
indexes body_html
indexes author

has created_at, updated_at
end

configuration:

indexer
{
}

searchd
{
listen = 127.0.0.1:9306:mysql41
log = /Volumes/eddy/Users/waltd/Documents/sandbox/lf-smith/log/development.searchd.log
query_log = /Volumes/eddy/Users/waltd/Documents/sandbox/lf-smith/log/development.searchd.query.log
pid_file = /Volumes/eddy/Users/waltd/Documents/sandbox/lf-smith/log/development.sphinx.pid
workers = threads
binlog_path = /Volumes/eddy/Users/waltd/Documents/sandbox/lf-smith/tmp/binlog/development
}

source document_core_0
{
type = mysql
sql_host = localhost
sql_user = root
sql_pass =
sql_db = lf-smith_development
sql_query_pre = SET TIME_ZONE = '+0:00'
sql_query_pre = SET NAMES utf8
sql_query = SELECT SQL_NO_CACHE `documents`.`id` * 4 + 0 AS `id`, `documents`.`title` AS `title`, `documents`.`teaser` AS `teaser`, `documents`.`body_html` AS `body_html`, `documents`.`author` AS `author`, `documents`.`id` AS `sphinx_internal_id`, 'Document' AS `sphinx_internal_class`, 0 AS `sphinx_deleted`, UNIX_TIMESTAMP(`documents`.`created_at`) AS `created_at`, UNIX_TIMESTAMP(`documents`.`updated_at`) AS `updated_at` FROM `documents` WHERE (`documents`.`id` BETWEEN $start AND $end AND published) GROUP BY `documents`.`id`, `documents`.`title`, `documents`.`teaser`, `documents`.`body_html`, `documents`.`author`, `documents`.`id`, `documents`.`created_at`, `documents`.`updated_at` ORDER BY NULL
sql_query_range = SELECT IFNULL(MIN(`documents`.`id`), 1), IFNULL(MAX(`documents`.`id`), 1) FROM `documents`
sql_attr_uint = sphinx_deleted
sql_attr_bigint = sphinx_internal_id
sql_attr_timestamp = created_at
sql_attr_timestamp = updated_at
sql_attr_string = sphinx_internal_class
}

index document_core
{
type = plain
path = /Volumes/eddy/Users/waltd/Documents/sandbox/lf-smith/db/sphinx/development/document_core
docinfo = extern
morphology = stem_en
html_strip = 1
source = document_core_0
}

and core YAML file:

default: &default
morphology: stem_en
html_strip: true

development:
<<: *default

test:
<<: *default

production:
<<: *default


All of this is ripped straight from the documentation, as far as I can see. Can you recommend any changes to make this work without that warning? Or do I not need to worry about that? The search seems to work just fine.

Walter

Pat Allan

unread,
Mar 1, 2019, 1:48:17 AM3/1/19
to thinkin...@googlegroups.com
Hi Walter,

That warning definitely shouldn’t have been happening - I’d missed excerpts in the list of known options. I’ve just pushed a fix to the develop branch on GitHub, and will get a new release out in the next week or so.

Cheers,


Pat
> --
> 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 thinking-sphi...@googlegroups.com.
> To post to this group, send email to thinkin...@googlegroups.com.
> Visit this group at https://groups.google.com/group/thinking-sphinx.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages