| 20 | | @total_hits = index.search_each(query, :limit => @per_page, :offset=>@offset){|index_id, score| |
|---|
| 21 | | begin |
|---|
| 22 | | found_doc=Document.new(index[index_id][:complete_path]) |
|---|
| 23 | | found_doc.matching_content=index.highlight(query, index_id, |
|---|
| 24 | | :field => :content, :excerpt_length => 80, |
|---|
| 25 | | :pre_tag => "<<", :post_tag => ">>" |
|---|
| 26 | | ) unless @raw_query=~/^\*+\.\w*$/ |
|---|
| 27 | | found_doc.score=score |
|---|
| 28 | | @matching_documents<<found_doc |
|---|
| 29 | | rescue Errno::ENOENT |
|---|
| 30 | | #"File has been moved/deleted!" |
|---|
| 31 | | end |
|---|
| | 20 | @total_hits = index.search_each(query, :limit => @per_page, :offset=>@offset){|index_id, score| |
|---|
| | 21 | begin |
|---|
| | 22 | found_doc=Document.new(index[index_id][:complete_path]) |
|---|
| | 23 | found_doc.matching_content=index.highlight(query, index_id, |
|---|
| | 24 | :field => :content, :excerpt_length => 80, |
|---|
| | 25 | :pre_tag => "<<", :post_tag => ">>" |
|---|
| | 26 | ) |
|---|
| | 27 | found_doc.score=score |
|---|
| | 28 | @matching_documents<<found_doc |
|---|
| | 29 | rescue Errno::ENOENT |
|---|
| | 30 | #"File has been moved/deleted!" |
|---|
| | 31 | end |
|---|