# Search Error

**URL:** <https://www.ruby-forum.com/t/search-error/108040>\
**Category:** Rails\
**Created:** [June 28, 2007, 4:56pm UTC](https://www.ruby-forum.com/t/search-error/108040 "2007-06-28T16:56:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![saurabhbhatia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/91b2a8/32.png) [@saurabhbhatia](https://www.ruby-forum.com/u/saurabhbhatia)\
**Post date:** [June 28, 2007, 4:56pm UTC](https://www.ruby-forum.com/t/search-error/108040/1 "2007-06-28T16:56:45Z")

</div>

Hi all,  
I’m trying to implement search features in my application.I’m using  
act\_as\_ferret plugins. But i’m facing some problems. The problem is ,  
I am not able to display the search results in the get\_results.rhtml  
page. Also, once the index is built and I dont delete the previous  
one, it throws the following error:

NoMethodError in Search#get\_results

Showing app/views/search/get\_results.rhtml where line #5 raised:

undefined method `field’ for {}:Ferret::Index::LazyDoc

Extracted source (around line #5):

2:  
3: \<% for result in @results -%\>  
4:

5:   
**6: \<%= result.field(‘title’).string\_value %\>\</  
strong\>**  
  
**7: \<%=  
highlight(result.field(‘teaser’).string\_value,  
 @search\_term) %\>**  
  
**8:**

RAILS\_ROOT: C:/INSTAN~1.7-W/INSTAN~1/rails\_apps/ferret\_test/config/…  
Application Trace | Framework Trace | Full Trace

#{RAILS\_ROOT}/app/views/search/get\_results.rhtml:5:in  
`_run_rhtml_47app47views47search47get_results46rhtml' #{RAILS_ROOT}/app/views/search/get_results.rhtml:3:in`each’  
#{RAILS\_ROOT}/app/views/search/get\_results.rhtml:3:in  
`\_run\_rhtml\_47app47views47search47get\_results46rhtml’

C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_view/base.rb:326:in `send' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_view/base.rb:326:in`compile\_and\_render\_template’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_view/base.rb:301:in `render_template' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_view/base.rb:260:in`render\_file’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/base.rb:806:in `render_file' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/base.rb:711:in`render\_with\_no\_layout’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/layout.rb:256:in `render_without_benchmark' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/benchmarking.rb:50:in`render’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/1.8/benchmark.rb:293:in  
`measure' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/benchmarking.rb:50:in`render’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/base.rb:1096:in `perform_action_without_filters' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/filters.rb:632:in`call\_filter’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/filters.rb:619:in  
`perform_action_without_benchmark' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/benchmarking.rb:66:in`perform\_action\_without\_rescue’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/1.8/benchmark.rb:293:in  
`measure' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/benchmarking.rb:66:in`perform\_action\_without\_rescue’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/rescue.rb:83:in `perform_action' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/base.rb:430:in`send’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/base.rb:430:in `process_without_filters' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/filters.rb:624:in`process\_without\_session\_management\_support’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/session\_management.rb:114:in `process' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/base.rb:330:in`process’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/  
dispatcher.rb:41:in `dispatch' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel/rails.rb:78:in`process’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel/rails.rb:76:in `synchronize' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel/rails.rb:76:in`process’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel.rb:618:in `process_client' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel.rb:617:in`each’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel.rb:617:in `process_client' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel.rb:736:in`run’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel.rb:736:in `initialize' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel.rb:736:in`new’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel.rb:736:in `run' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel.rb:720:in`initialize’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel.rb:720:in `new' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel.rb:720:in`run’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel/configurator.rb:271:in `run' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel/configurator.rb:270:in`each’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel/configurator.rb:270:in `run' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/bin/mongrel_rails:127:in`run’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel/command.rb:211:in `run' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/bin/mongrel_rails:243 C:/INSTAN~1.7-W/INSTAN~1/ruby/bin/mongrel_rails:16:in`load’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/bin/mongrel\_rails:16

#{RAILS\_ROOT}/app/views/search/get\_results.rhtml:5:in  
`_run_rhtml_47app47views47search47get_results46rhtml' #{RAILS_ROOT}/app/views/search/get_results.rhtml:3:in`each’  
#{RAILS\_ROOT}/app/views/search/get\_results.rhtml:3:in  
`_run_rhtml_47app47views47search47get_results46rhtml' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_view/base.rb:326:in`send’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_view/base.rb:326:in `compile_and_render_template' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_view/base.rb:301:in`render\_template’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_view/base.rb:260:in `render_file' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/base.rb:806:in`render\_file’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/base.rb:711:in `render_with_no_layout' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/layout.rb:256:in`render\_without\_benchmark’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/benchmarking.rb:50:in `render' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/1.8/benchmark.rb:293:in`measure’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/benchmarking.rb:50:in `render' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/base.rb:1096:in`perform\_action\_without\_filters’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/filters.rb:632:in `call_filter' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/filters.rb:619:in`perform\_action\_without\_benchmark’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/benchmarking.rb:66:in  
`perform_action_without_rescue' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/1.8/benchmark.rb:293:in`measure’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/benchmarking.rb:66:in  
`perform_action_without_rescue' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/rescue.rb:83:in`perform\_action’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/base.rb:430:in `send' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/base.rb:430:in`process\_without\_filters’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/filters.rb:624:in  
`process_without_session_management_support' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/ actionpack-1.13.3/ lib/action_controller/session_management.rb:114:in`process’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/  
actionpack-1.13.3/  
lib/action\_controller/base.rb:330:in `process' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/ dispatcher.rb:41:in`dispatch’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel/rails.rb:78:in `process' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel/rails.rb:76:in`synchronize’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel/rails.rb:76:in `process' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel.rb:618:in`process\_client’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel.rb:617:in `each' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel.rb:617:in`process\_client’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel.rb:736:in `run' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel.rb:736:in`initialize’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel.rb:736:in `new' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel.rb:736:in`run’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel.rb:720:in `initialize' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel.rb:720:in`new’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel.rb:720:in `run' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel/configurator.rb:271:in`run’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/lib/mongrel/configurator.rb:270:in `each' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel/configurator.rb:270:in`run’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/bin/mongrel\_rails:127:in `run' C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1- mswin32/lib/mongrel/command.rb:211:in`run’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-  
mswin32/bin/mongrel\_rails:243  
C:/INSTAN~1.7-W/INSTAN~1/ruby/bin/mongrel\_rails:16:in `load’  
C:/INSTAN~1.7-W/INSTAN~1/ruby/bin/mongrel\_rails:16

Request

Parameters: {“search”=\>{“search\_term”=\>“ajax”}, “commit”=\>“Search”}

Show session dump

* * *

flash: !map:ActionController::Flash::FlashHash {}

Response  
Headers: {“cookie”=\>[], “Cache-Control”=\>“no-cache”}
