| 150 | | assert_equal @content.id, contents_from_ferret.first.id |
|---|
| 151 | | @content.description = 'Updated description, still useless' |
|---|
| 152 | | @content.save |
|---|
| 153 | | contents_from_ferret = Content.find_by_contents('useless') |
|---|
| 154 | | assert_equal 1, contents_from_ferret.size |
|---|
| 155 | | assert_equal @content.id, contents_from_ferret.first.id |
|---|
| 156 | | contents_from_ferret = Content.find_by_contents('updated AND description') |
|---|
| 157 | | assert_equal 1, contents_from_ferret.size |
|---|
| 158 | | assert_equal @content.id, contents_from_ferret.first.id |
|---|
| 159 | | contents_from_ferret = Content.find_by_contents('updated OR description') |
|---|
| 160 | | assert_equal 1, contents_from_ferret.size |
|---|
| 161 | | assert_equal @content.id, contents_from_ferret.first.id |
|---|
| 162 | | end |
|---|
| 163 | | |
|---|
| 164 | | def test_update |
|---|
| 165 | | contents_from_ferret = Content.find_by_contents('useless') |
|---|
| 166 | | assert_equal 1, contents_from_ferret.size |
|---|
| 243 | | def test_multi_searcher |
|---|
| 244 | | s = MultiSearcher.new([Searcher.new(Content.class_index_dir), Searcher.new(Comment.class_index_dir)]) |
|---|
| 245 | | hits = s.search(TermQuery.new(:title,"title")) |
|---|
| 246 | | assert_equal 1, hits.total_hits |
|---|
| 247 | | end |
|---|
| | 226 | # segfaults (Feret 0.10.13) |
|---|
| | 227 | #def test_multi_searcher |
|---|
| | 228 | # s = MultiSearcher.new([Searcher.new(Content.class_index_dir), Searcher.new(Comment.class_index_dir)]) |
|---|
| | 229 | # hits = s.search(TermQuery.new(:title,"title")) |
|---|
| | 230 | # assert_equal 1, hits.total_hits |
|---|
| | 231 | #end |
|---|