Hi All, I have to have a site wide search for my current application. By search I mean I have to search the static and the dynamic contents from the database. I have been searching on this for a while on the net and RDig seems to be a apt solution. While using it I have encountered a few problems. I know these might be very basic issues but I have not been able to figure out what is wrong with the code. I had the following lines in my /config/environment.rb 1. require ''rdig'' 2. require ''rdig_config'' I have the following code in my /config/rdig_config.rb 1. RDig.configuration do |cfg| 2. cfg.crawler.start_urls = [ ''http://localhost:3000/login/index'' ] 3. cfg.index.path "C:/rails/managedsupport/index/development/rdig-index" 4. cfg.verbose = true 5. cfg.content_extraction = OpenStruct.new( 6. :hpricot => OpenStruct.new( 7. :title_tag_selector => ''title'', 8. :content_tag_selector => ''body'' 9. ) 10. ) 11. 12. end I have created the index file using the code 1. rdig -c config/rdig_config.rb Now in my controller I have written a code for testing the functionality 1. search_results = RDig.searcher.search("some_string") 2. @results = search_results[:list] 3. @hitcount = search_results[:hitcount] My @result[:extract]is returning me the same initial view code that is common to the application that is my menus and sub menus.. I am not getting the extract on the basis of which I had searched. Any help in this regard would be highly appreciated.. Thanks in advance:) -- Posted via http://www.ruby-forum.com/.
If you''re creating an index from a database, wouldn''t you use AAF? As far as I know, RDig is for indexing external pages. If you still want to try to get RDig to work, try crawling an external URI. If that doesn''t work, try it from the command line. -- Posted via http://www.ruby-forum.com/.
Eggman Eggman wrote:> If you''re creating an index from a database, wouldn''t you use AAF? As > far as I know, RDig is for indexing external pages. > > If you still want to try to get RDig to work, try crawling an external > URI. If that doesn''t work, try it from the command line.I am using AAF for indexing module search. But for searching the entire site some thing that would search both the static and the dynamic content. I have no clue in how to make the AAF to search the static content of my application. If you have done a simillar stuff could you be kind and share your experience or code with me,,, Cheers, jazzy -- Posted via http://www.ruby-forum.com/.