Skip to content
Browse files

add Chinese support

  • Loading branch information...
1 parent 7ab73a9 commit b6338b65002fd538ec0ecc617e0768b507673f84 @raecoo committed Oct 13, 2009
View
150 README.textile
@@ -1,144 +1,16 @@
-h1. Thinking Sphinx
+h1. Thinking Sphinx Chinese
h2. Usage
-First, if you haven't done so already, check out the main "usage":http://ts.freelancing-gods.com/usage.html page. Once you've done that, the next place to look for information is the specific method docs - ThinkingSphinx::Search and ThinkingSphinx::Index::Builder in particular.
+add follow set options into sphinx.yml then regenerate index and restart sphinx daemon that's ok
+--
+charset_type: zh_cn.utf-8
+charset_dictpath: <your/dict/full/path>
-Keep in mind that while Thinking Sphinx works for ActiveRecord with Merb, it doesn't yet support DataMapper (although that is planned).
-
-h2. Contributing
-
-Fork on GitHub and after you've committed tested patches, send a pull request.
-
-To quickly see if your system is ready to run the thinking sphinx specs, run the contribute.rb script found in the project root directory. Use the following instructions to install any missing requirements.
-
-To get the spec suite running, you will need to install the ginger gem:
-
- sudo gem install ginger --source http://gemcutter.org
-
-Then install the cucumber, yard, jeweler and rspec gems. Make sure you have a git install version 1.6.0.0 or higher, otherwise the jeweler gem won't install.
-
- sudo gem install cucumber yard jeweler rspec
-
-Then set up your database:
-
- cp spec/fixtures/database.yml.default spec/fixtures/database.yml
- mysqladmin -u root create thinking_sphinx
+NOTICE:
+ this plugin need run the sphinx Chinese patch first.
-This last step can be done automatically by the contribute.rb script if all dependencies are met.
-
-Make sure you don't have another Sphinx daemon (searchd) running. If you do, quit it with "rake ts:stop"
-in the app root.
-
-You should now have a passing test suite from which to build your patch on.
-
- rake spec
-
-If you get the message "Failed to start searchd daemon", run the spec with sudo:
-
- sudo rake spec
-
-If you quit the spec suite before it's completed, you may be left with data in the test
-database, causing the next run to have failures. Let that run complete and then try again.
-
-h2. Contributors
-
-Since I first released this library, there's been quite a few people who have submitted patches, to my immense gratitude. Others have suggested syntax changes and general improvements. So my thanks to the following people:
-
-* Joost Hietbrink
-* Jonathan Conway
-* Gregory Mirzayantz
-* Tung Nguyen
-* Sean Cribbs
-* Benoit Caccinolo
-* John Barton
-* Oliver Beddows
-* Arthur Zapparoli
-* Dusty Doris
-* Marcus Crafter
-* Patrick Lenz
-* Björn Andreasson
-* James Healy
-* Jae-Jun Hwang
-* Xavier Shay
-* Jason Rust
-* Gopal Patel
-* Chris Heald
-* Peter Vandenberk
-* Josh French
-* Andrew Bennett
-* Jordan Fowler
-* Seth Walker
-* Joe Noon
-* Wolfgang Postler
-* Rick Olson
-* Killian Murphy
-* Morten Primdahl
-* Ryan Bates
-* David Eisinger
-* Shay Arnett
-* Minh Tran
-* Jeremy Durham
-* Piotr Sarnacki
-* Matt Johnson
-* Nicolas Blanco
-* Max Lapshin
-* Josh Natanson
-* Philip Hallstrom
-* Christian Rishøj
-* Mike Flester
-* Jim Remsik
-* Kennon Ballou
-* Henrik Nyh
-* Emil Tin
-* Doug Cole
-* Ed Hickey
-* Evan Weaver
-* Thibaut Barrere
-* Kristopher Chambers
-* Dmitrij Smalko
-* Aleksey Yeschenko
-* Lachie Cox
-* Lourens Naude
-* Tom Davies
-* Dan Pickett
-* Alex Caudill
-* Jim Benton
-* John Aughey
-* Keith Pitty
-* Jeff Talbot
-* Dana Contreras
-* Menno van der Sman
-* Bill Harding
-* Isaac Feliu
-* Andrei Bocan
-* László Bácsi
-* Peter Wagenet
-* Max Lapshin
-* Martin Emde
-* David Wennergren
-* Mark Lane
-* Eric Lindvall
-* Lawrence Pit
-* Mike Bailey
-* Bill Leeper
-* Michael Reinsch
-* Anderson Dias
-* Jerome Riga
-* Tien Dung
-* Johannes Kaefer
-* Paul Campbell
-* Matthew Beale
-* Tom Simnett
-* Erik Ostrom
-* Ole Riesenberg
-* Josh Kalderimis
-* J.D. Hollis
-* Jeffrey Chupp
-* Rob Anderton
-* Zach Inglis
-* Ward Bekker
-* Brian Terlson
-* Christian Aust
-* Martin Sarasale
-* Édouard Brière
+Sphinx Chinese Patch:
+ http://www.coreseek.com
+
+more options informations pls forward to http://github.com/freelancing-god/thinking-sphinx
View
5 lib/thinking_sphinx/configuration.rb
@@ -52,7 +52,7 @@ class Configuration
SourceOptions = %w( mysql_connect_flags sql_range_step sql_query_pre
sql_query_post sql_ranged_throttle sql_query_post_index )
- IndexOptions = %w( charset_table charset_type docinfo enable_star
+ IndexOptions = %w( charset_table charset_type charset_dictpath docinfo enable_star
exceptions html_index_attrs html_remove_elements html_strip ignore_chars
min_infix_len min_prefix_len min_word_len mlock morphology ngram_chars
ngram_len phrase_boundary phrase_boundary_step preopen stopwords
@@ -63,7 +63,8 @@ class Configuration
attr_accessor :config_file, :searchd_log_file, :query_log_file,
:pid_file, :searchd_file_path, :address, :port, :allow_star,
:database_yml_file, :app_root, :bin_path, :model_directories,
- :delayed_job_priority, :searchd_binary_name, :indexer_binary_name
+ :delayed_job_priority, :searchd_binary_name, :indexer_binary_name,
+ :charset_dictpath
attr_accessor :source_options, :index_options
View
2 lib/thinking_sphinx/source.rb
@@ -144,7 +144,7 @@ def all_associations
end
def utf8?
- @index.options[:charset_type] == "utf-8"
+ @index.options[:charset_type] =~ /utf-8|zh_cn.utf-8/
end
end
end
View
4 vendor/riddle/lib/riddle/configuration/index.rb
@@ -2,15 +2,15 @@ module Riddle
class Configuration
class Index < Riddle::Configuration::Section
self.settings = [:source, :path, :docinfo, :mlock, :morphology,
- :stopwords, :wordforms, :exceptions, :min_word_len, :charset_type,
+ :stopwords, :wordforms, :exceptions, :min_word_len, :charset_type, :charset_dictpath,
:charset_table, :ignore_chars, :min_prefix_len, :min_infix_len,
:prefix_fields, :infix_fields, :enable_star, :ngram_len, :ngram_chars,
:phrase_boundary, :phrase_boundary_step, :html_strip,
:html_index_attrs, :html_remove_elements, :preopen]
attr_accessor :name, :parent, :sources, :path, :docinfo, :mlock,
:morphologies, :stopword_files, :wordform_files, :exception_files,
- :min_word_len, :charset_type, :charset_table, :ignore_characters,
+ :min_word_len, :charset_type, :charset_table, :ignore_characters, :charset_dictpath,
:min_prefix_len, :min_infix_len, :prefix_field_names,
:infix_field_names, :enable_star, :ngram_len, :ngram_characters,
:phrase_boundaries, :phrase_boundary_step, :html_strip,

0 comments on commit b6338b6

Please sign in to comment.
Something went wrong with that request. Please try again.