To edit pages or tickets please login with username/password: aaf/aaf

Changeset 263

Show
Ignore:
Timestamp:
11/14/07 09:15:08 (1 year ago)
Author:
jk
Message:

add testcase for custom analyzer

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/demo/app/models/comment.rb

    r246 r263  
    1818                  :additional_fields => { 
    1919                    :added => { :index => :untokenized, :store => :yes, :ignore => true } 
    20                   }
     20                  }, :ferret => { :analyzer => Ferret::Analysis::StandardAnalyzer.new(['fax', 'gsm', 'the', 'or']) }
    2121 
    2222  # only index the named fields: 
  • trunk/demo/config/database.yml

    r236 r263  
    3131 
    3232# SQLITE 
    33 #development: 
    34 #  adapter: sqlite3 
    35 #  dbfile: db/dev.sqlite 
     33development: 
     34  adapter: sqlite3 
     35  dbfile: db/dev.sqlite 
    3636 
    37 #test: 
    38 #  adapter: sqlite3 
    39 #  dbfile: db/test.sqlite 
     37test: 
     38  adapter: sqlite3 
     39  dbfile: db/test.sqlite 
    4040 
  • trunk/demo/test/unit/comment_test.rb

    r228 r263  
    1111  def test_truth 
    1212    assert_kind_of Comment, comments(:first) 
     13  end 
     14 
     15  def test_analyzer 
     16    c = Comment.create! :content => 'a fax modem' 
     17    assert_equal 0, Comment.find_with_ferret('fax').size 
     18    assert_equal 1, Comment.find_with_ferret('modem').size 
    1319  end 
    1420 

To edit pages or tickets please login with username/password: aaf/aaf