Tips and tricks for getting the best out of solr on windows azure

2,956 views

Published on

Presented by Brian Benz, Senior Technical Evangelist, Microsoft Open Technologies, Inc.

This session will cover tips and tricks for getting the most out of Solr in Windows Azure. Windows 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’ll cover multiple options for setting up Solr in Windows Azure, including working examples.

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,956
On SlideShare
0
From Embeds
0
Number of Embeds
209
Actions
Shares
0
Downloads
32
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Tips and tricks for getting the best out of solr on windows azure

  1. 1. Solr on WindowsAzureBrian BenzSeniorTechnicalEvangelist,MicrosoftOpenTechnologies,Inc.
  2. 2. Manage Windows Azure Featureshttp://www.windowsazure.comSolr search PHP Apphttp://a-jamepi-php-linuxvm-solr-searchdemo.azurewebsites.net/search.phpSolr search ASP.NET Apphttp://a-jamepi-aspnet-linuxvm-solr-searchdemo.azurewebsites.net/
  3. 3. Flexible
  4. 4. South Central USWest US East US
  5. 5. > 500 miles
  6. 6. VM depot Imagehttp://vmdepot.msopentech.com/Vhd/Show?vhdId=278&version=292azure vm create bbenz-solr -o vmdepot-214-1-1-l "West US" bbenz <password> --vm-namebbenz-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 optionscurl_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 = newList<SearchResultsItem>();try{Session["SearchWord"] = SearchWord;hdrResultsHeader.Visible = false;
  13. 13. NetworkCredential MyNetworkCredentials = newNetworkCredential(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 = newSearchResultsItem();FoundItem.Title = ExtractString("<arrname="title"><str>", "</str>", Item);FoundItem.Description = ExtractString("<strname="description">", "</str>", Item);FoundItem.Link = ExtractString("<str name="id">","</str>", Item);FoundItems.Add(FoundItem);}}
  17. 17. CONTACTBrian Benzbbenz@microsoft.com

×