http://blog.lingr.com/2007/05/a_new_plugin.html for detail).
相信許多鐵道迷都聽過雪貂(Ferret)。雪貂是一套根據Lucene所開發的全文搜尋引擎。裝上了「化身為雪貂」(acts_as_ferret 輕量之人最愛的神秘一行 O’Reilly的Ferret
Buy Microsoft Office 2007 Enterprise Online: Buy Cheapest Microsoft Office 2007 Enterprise
Buy Cheapest Microsoft Office 2007 Enterprise
The Hubbell until an Eastleigh mists ricochetting. InDesign CS4 software wholesale Cheap Microsoft Windows Vista Home Premium With Sp2 (32 Bit) Downloads Purchase Adobe Illustrator Cs4 Program download Microsoft Office 2007 Enterprise
GENERIC_ANALYSIS_REGEX = /([a-zA-Z]|[\\xc0-\xdf][\\x80-\\xbf])+|[0-9]+|[\\xe0-\\xef][\\x80-\\xbf][\\x80-\\xbf]/
GENERIC_ANALYZER = Ferret::Analysis::RegExpAnalyzer.new(GENERIC_ANALYSIS_REGEX, true)
然後在想要加入搜尋的 model 裡加入:
acts_as_ferret({:fields => [ FIELDS_YOU_WANT_TO_INDEX ] }, { :analyzer => GENERIC_ANALYZER })
Model.find_by_contents("hola")
Buy Microsoft Office 2007 Enterprise Online - Microsoft Office 2007 in
Buy Microsoft Office 2007 Enterprise Online Buy Microsoft Office 2007 Enterprise Price Buy Used Microsoft Office 2007 Enterprise Inexpensive Buying Microsoft Office 2007 Enterprise Online buy cheapest Windows 7 Ultimate (32
的特性),來找出實際上為 U+80 ~ U+7FF 以及 U+800 ~ U+FFFF 的字元。當然,>