Skip to content

Commit

Permalink
Merge pull request #3162 from 3scale/update-thinking-sphinx-configura…
Browse files Browse the repository at this point in the history
…tion

Update Thinking Sphinx configuration file: add batch_size
  • Loading branch information
mayorova authored Jan 18, 2023
2 parents 48dcc0b + 317cb83 commit 94f7ce0
Showing 1 changed file with 29 additions and 30 deletions.
59 changes: 29 additions & 30 deletions config/docker/thinking_sphinx.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
common: &sphinx
configuration_file: <%= ENV.fetch('THINKING_SPHINX_CONFIGURATION_FILE') { Rails.root.join("config/#{Rails.env}.sphinx.conf")} %>
production:
# ----------------------------------
# Thinking Sphinx configuration
# see https://gist.github.com/pat/a7d73376dd657b4457092efc9e9c418a
# ----------------------------------
mysql41: 9306
address: <%= ENV['THINKING_SPHINX_ADDRESS'] || '0.0.0.0' %>

big_document_ids: true

configuration_file: <%= ENV.fetch('THINKING_SPHINX_CONFIGURATION_FILE') { Rails.root.join("config/#{Rails.env}.sphinx.conf")} %>

# Batch size for real-time index processing (via the `ts:index` and `ts:rebuild` tasks), the default is 1000
batch_size: <%= ENV.fetch('THINKING_SPHINX_BATCH_SIZE', 1000) %>

# ----------------------------------
# Sphinx index configuration, see http://sphinxsearch.com/docs/current.html#confgroup-index
# ----------------------------------
charset_table: 0..9, A..Z->a..z, a..z # strip _ from words

html_strip: 1
html_remove_elements: "style, script"
html_index_attrs: "img=alt,title; a=title"
min_infix_len: 3
pid_file: <%= ENV.fetch('THINKING_SPHINX_PID_FILE') { Rails.root.join('log', "searchd.#{Rails.env}.pid") } %>

# ----------------------------------
# Data source configuration, see http://sphinxsearch.com/docs/current.html#confgroup-source
# ----------------------------------

# This is from TS FAQ - makes reindex MUCH faster.
sql_range_step: 2000000000

charset_table: 0..9, A..Z->a..z, a..z # strip _ from words
# ----------------------------------
# Sphinx daemon (searchd) configuration, see http://sphinxsearch.com/docs/current.html#confgroup-searchd
# ----------------------------------

# Use standard output for logs in container environments
query_log: /dev/stdout
log: /dev/stdout

development:
<<: *sphinx

test: &test
<<: *sphinx
<% case ENV['DATABASE_URL'].to_s
when /^oracle/ %>
sql_port: 1521
<% when /^postgresql/ %>
sql_port: 5432
<% else %>
mysql41: <%= 9313 + ENV['TEST_ENV_NUMBER'].to_i %>
<% end %>
configuration_file: <%= Rails.root.join('config', "test#{ENV['TEST_ENV_NUMBER']}.sphinx.conf") %>
indices_location: <%= Rails.root.join("db/sphinx/test#{ENV['TEST_ENV_NUMBER']}") %>
pid_file: <%= Rails.root.join("log/searchd.test#{ENV['TEST_ENV_NUMBER']}.pid") %>
hard_retry_count: 5
binlog_path: ''

preview:
<<: *sphinx
binlog_path: ''
address: <%= ENV['THINKING_SPHINX_ADDRESS'] || '0.0.0.0' %>
pid_file: <%= ENV.fetch('THINKING_SPHINX_PID_FILE') { Rails.root.join('log', "searchd.#{Rails.env}.pid") } %>

production:
<<: *sphinx
binlog_path: ''
address: <%= ENV['THINKING_SPHINX_ADDRESS'] || '0.0.0.0' %>

0 comments on commit 94f7ce0

Please sign in to comment.