{"id":161,"date":"2010-05-02T23:08:04","date_gmt":"2010-05-03T06:08:04","guid":{"rendered":"http:\/\/blogs.oregonstate.edu\/osucws\/?p=161"},"modified":"2013-05-11T23:17:43","modified_gmt":"2013-05-12T06:17:43","slug":"how-to-get-search-on-your-page","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/osucws\/osu-search\/how-to-get-search-on-your-page\/","title":{"rendered":"How to get Search on your page"},"content":{"rendered":"<div>\n<div>\n<p><em><strong>Please check this page frequently.\u00a0 Updates to code  for integrating search for sites will be provided here.<\/strong><\/em><\/p>\n<p>OSU Search lets users search for your content across all of OSU. No  matter where they type in their query, results from across OSU will be  displayed for any visitors.<\/p>\n<p>As of January 1st, 2010.\u00a0 OSU has switched to using the Google Search  Appliance.<\/p>\n<h2>How can you tell if you are using the old search?<\/h2>\n<p>Simple.\u00a0 If your search results goes to search.oregonstate.edu\/web in the url string, you are on the old search.\u00a0 If you are using Drupal (see below), it means custom code was inserted and will need to be changed by you or whomever helped develop your site.\u00a0 If you need assistance, <a title=\"Contact CWS\" href=\"http:\/\/oregonstate.edu\/cws\/contact\">contact CWS<\/a>.<\/p>\n<h2>What does this mean to you?<\/h2>\n<p>If you are a site hosted by Central Web Services using OSU Drupal 5  or OSU Drupal 6 hosted solutions, the search switchover will be  transparent and no action needs to be taken.\u00a0 Please note, if you have  installed drupal or other software solutions yourselves, and not using  the centrally hosted CWS solution, you will be responsible for switching  these over.<\/p>\n<p>If you are maintaining static sites, whether hosted with CWS or not,  with html code embedded for using the Nutch search engine (as referenced  in the form with a url of search.oregonstate.edu\/web) then you will  need to replace the code with one of the two following options:<\/p>\n<\/div>\n<div>\n<h2>Code<\/h2>\n<p>We have two methods for you to include a search box into your website. The first method and preferred method is using PHP or another programming language. The first method ensures that when we add new features to search boxes in the future, your website we&#8217;ll get the updates. The second method is only recommended if you have static html websites.<\/p>\n<h3>Using PHP (preferred)<\/h3>\n<p>To search all of OSU, paste the code below in your php file. If you are<br \/>\nusing any other programming language, you basically have to create an array<br \/>\nand turn it into a json string. Then request the url over the web.<\/p>\n<p><code><br \/>\n$options = array(<br \/>\n'url'   =&gt;  'http:\/\/oregonstate.edu\/cws'<br \/>\n);<br \/>\n$json = json_encode($options);<br \/>\n$url = 'http:\/\/search.oregonstate.edu\/libs.php?q=osusearch_searchbox&amp;o='.urlencode($json);<br \/>\necho file_get_contents($url);<br \/>\n<\/code><\/p>\n<h3>Using HTML<\/h3>\n<p>For sites using static HTML, please use the link below to contact us and we will help you set up a search box for your site.<\/p>\n<p>If you have questions regarding this process, use the <a title=\"Contact CWS\" href=\"http:\/\/oregonstate.edu\/cws\/contact\">contact  form<\/a> and select Search to send us your question.<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Please check this page frequently.\u00a0 Updates to code for integrating search for sites will be provided here. OSU Search lets users search for your content across all of OSU. No matter where they type in their query, results from across OSU will be displayed for any visitors. As of January 1st, 2010.\u00a0 OSU has switched&hellip; <a href=\"https:\/\/blogs.oregonstate.edu\/osucws\/osu-search\/how-to-get-search-on-your-page\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":5047,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1508],"tags":[],"class_list":["post-161","post","type-post","status-publish","format-standard","hentry","category-osu-search"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/osucws\/wp-json\/wp\/v2\/posts\/161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/osucws\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/osucws\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/osucws\/wp-json\/wp\/v2\/users\/5047"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/osucws\/wp-json\/wp\/v2\/comments?post=161"}],"version-history":[{"count":32,"href":"https:\/\/blogs.oregonstate.edu\/osucws\/wp-json\/wp\/v2\/posts\/161\/revisions"}],"predecessor-version":[{"id":793,"href":"https:\/\/blogs.oregonstate.edu\/osucws\/wp-json\/wp\/v2\/posts\/161\/revisions\/793"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/osucws\/wp-json\/wp\/v2\/media?parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/osucws\/wp-json\/wp\/v2\/categories?post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/osucws\/wp-json\/wp\/v2\/tags?post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}