This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
FAQ
- Q: How do I apply stemming?
- Sphinx comes with a built-in stemmer, or you can re-compile sphinx with the
--with-stemmerflag. - Q: How do I see the relevance (weight) of each search match?
- Like this:
@results.each_with_weighting do |result, weight| ... end - Q: What are the sort modes?
- Each sort mode is available by the corresponding key in the search hash: For SPH_SORT_EXPR, you would set
:sort_mode => :expr. (See the sphinx docs for a list). For example, to balance search relevance with some sort of independently-determined score:
@results ||= Post.search(self.query, :sort_mode => :expr, :sort_by => '(@weight * 0.01) + score', :match_mode => :extended, :page => params[:page] ) - Q: Sphinx global settings
- The contents of
RAILS_ROOT/config/sphinx.ymlare injected into the actual sphinx .conf file.
Example:
defaults: &defaults max_matches: 2000 # http://www.sphinxsearch.com/docs/current.html#conf-stopwords stopwords: 'config/sphinx/stopwords.txt' # http://www.sphinxsearch.com/docs/current.html#conf-wordforms wordforms: 'config/sphinx/wordforms.txt' # http://www.sphinxsearch.com/docs/current.html#conf-morphology morphology: libstemmer_en development: << *defaults production: << *defaults staging: << *defaults test: << *defaults
Interesting global settings inlude:
Wildcarding:
enable_star: 1 min_infix_len: 1 - Q: I installed Sphinx as a frozen gem instead of a plugin. I can’t see the rake tasks
- Add the following lines to your Rakefile:
Dir.glob(File.join(File.dirname(__FILE__), 'vendor/gems/*/tasks/rails.rake')) do |tasksfile| load tasksfile end
More details: https://rails.lighthouseapp.com/projects/8994/tickets/59







