Solr on Microsoft Azure

552 views
451 views

Published on

This session was presented at Lucene Solr Revolution 2013. It covered tips and tricks for getting the most out of Solr in Microsoft Azure. Azure enables quick and easy installation and setup of Solr search functionality in a variety of ways, and lets you focus on managing and operating Solr servers in our managed environment. We showed multiple options for setting up Solr on Azure, including working examples.

Published in: Internet, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
552
On SlideShare
0
From Embeds
0
Number of Embeds
21
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Solr on Microsoft Azure

  1. 1. Solr on WindowsAzure Brian Benz SeniorTechnicalEvangelist,MicrosoftOpenTechnologies,Inc.
  2. 2. Manage Windows Azure Features http://www.windowsazure.com Solr search PHP App http://a-jamepi-php-linuxvm-solr-searchdemo.azurewebsites.net/search.php Solr search ASP.NET App http://a-jamepi-aspnet-linuxvm-solr-searchdemo.azurewebsites.net/
  3. 3. Flexible
  4. 4. South Central US West US East US
  5. 5. > 500 miles
  6. 6. VM depot Image http://vmdepot.msopentech.com/Vhd/Show?vhdId=278&version=292 azure vm create bbenz-solr -o vmdepot-214-1-1 -l "West US" bbenz <password> --vm-name bbenz-solrvm
  7. 7. From your Azure Subscription
  8. 8. http://www.windowsazure.com/en-us/develop/overview/
  9. 9. http://www.windowsazure.com/en-us/develop/java/ http://www.microsoft.com/web/webmatrix/ http://www.windowsazure.com/en-us/develop/net/common- tasks/publishing-with-git/#Step7
  10. 10. <!-- top content area --> <div align="center" id="header"> <h1>Solr Windows Azure search demo</h1> Windowsazure.com | licene.apache.org/solr <div id="search" align="right"> <form> Search me <input type="text" name="names" onkeyup="showResults(this.value)"> </form> </div> </div> <!-- end top content area -->
  11. 11. // Setting curl options curl_setopt_array( $ch, $options ); // Getting results $response = curl_exec($ch); // Getting jSON result string $response = json_decode($response, true);
  12. 12. private void RunSearch(string SearchWord) { List<SearchResultsItem> FoundItems = new List<SearchResultsItem>(); try { Session["SearchWord"] = SearchWord; hdrResultsHeader.Visible = false;
  13. 13. NetworkCredential MyNetworkCredentials = new NetworkCredential(Resources.User, Resources.Password); HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(Resources.SolrLink + SearchWord);
  14. 14. HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(WebResp.GetResponseStream()); XmlNodeList ItemNodes = xmlDoc.SelectNodes("/response/result/doc");
  15. 15. HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(WebResp.GetResponseStream()); XmlNodeList ItemNodes = xmlDoc.SelectNodes("/response/result/doc");
  16. 16. foreach (XmlNode Item in ItemNodes) { SearchResultsItem FoundItem = new SearchResultsItem(); FoundItem.Title = ExtractString("<arr name="title"><str>", "</str>", Item); FoundItem.Description = ExtractString("<str name="description">", "</str>", Item); FoundItem.Link = ExtractString("<str name="id">", "</str>", Item); FoundItems.Add(FoundItem); } }
  17. 17. CONTACT Brian Benz bbenz@microsoft.com

×