47
Solr on Windows Azure Brian Benz Senior Technical Evangelist, Microsoft Open Technologies, Inc.

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

Embed Size (px)

DESCRIPTION

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.

Citation preview

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

Solr on Windows Azure Brian BenzSenior Technical Evangelist, Microsoft Open Technologies, Inc.

Page 2: Tips and tricks for getting the best out of solr on windows azure
Page 3: Tips and tricks for getting the best out of solr on windows azure

Manage Windows Azure Featureshttp://www.windowsazure.com

Solr search PHP Apphttp://a-jamepi-php-linuxvm-solr-searchdemo.azurewebsites.net/search.php

Solr search ASP.NET Apphttp://a-jamepi-aspnet-linuxvm-solr-searchdemo.azurewebsites.net/

Page 4: Tips and tricks for getting the best out of solr on windows azure
Page 5: Tips and tricks for getting the best out of solr on windows azure
Page 6: Tips and tricks for getting the best out of solr on windows azure
Page 7: Tips and tricks for getting the best out of solr on windows azure
Page 8: Tips and tricks for getting the best out of solr on windows azure

Flexible

Page 9: Tips and tricks for getting the best out of solr on windows azure
Page 10: Tips and tricks for getting the best out of solr on windows azure
Page 11: Tips and tricks for getting the best out of solr on windows azure
Page 12: Tips and tricks for getting the best out of solr on windows azure

South Central US

West US East US

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

> 500 miles

Page 14: Tips and tricks for getting the best out of solr on windows azure
Page 15: Tips and tricks for getting the best out of solr on windows azure

VM depot Imagehttp://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

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

From your Azure Subscription

Page 17: Tips and tricks for getting the best out of solr on windows azure
Page 18: Tips and tricks for getting the best out of solr on windows azure
Page 19: Tips and tricks for getting the best out of solr on windows azure
Page 20: Tips and tricks for getting the best out of solr on windows azure
Page 21: Tips and tricks for getting the best out of solr on windows azure
Page 22: Tips and tricks for getting the best out of solr on windows azure
Page 23: Tips and tricks for getting the best out of solr on windows azure
Page 24: Tips and tricks for getting the best out of solr on windows azure
Page 25: Tips and tricks for getting the best out of solr on windows azure

http://www.windowsazure.com/en-us/develop/overview/

Page 26: Tips and tricks for getting the best out of solr on windows azure
Page 27: Tips and tricks for getting the best out of solr on windows azure
Page 28: Tips and tricks for getting the best out of solr on windows azure
Page 29: Tips and tricks for getting the best out of solr on windows azure
Page 30: Tips and tricks for getting the best out of solr on windows azure

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

Page 31: Tips and tricks for getting the best out of solr on windows azure
Page 32: Tips and tricks for getting the best out of solr on windows azure
Page 33: Tips and tricks for getting the best out of solr on windows azure
Page 34: Tips and tricks for getting the best out of solr on windows azure
Page 35: Tips and tricks for getting the best out of solr on windows azure

<!-- 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 -->

Page 36: Tips and tricks for getting the best out of solr on windows azure
Page 37: Tips and tricks for getting the best out of solr on windows azure

// Setting curl options

curl_setopt_array( $ch, $options );

// Getting results

$response = curl_exec($ch);

// Getting jSON result string

$response = json_decode($response, true);

Page 38: Tips and tricks for getting the best out of solr on windows azure
Page 39: Tips and tricks for getting the best out of solr on windows azure
Page 40: Tips and tricks for getting the best out of solr on windows azure
Page 41: Tips and tricks for getting the best out of solr on windows azure

private void RunSearch(string SearchWord)

{

List<SearchResultsItem> FoundItems = new

List<SearchResultsItem>();

try

{

Session["SearchWord"] = SearchWord;

hdrResultsHeader.Visible = false;

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

NetworkCredential MyNetworkCredentials = new

NetworkCredential(Resources.User, Resources.Password);

HttpWebRequest WebReq =

(HttpWebRequest)WebRequest.Create(Resources.SolrLink +

SearchWord);

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

HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();

XmlDocument xmlDoc = new XmlDocument();

xmlDoc.Load(WebResp.GetResponseStream());

XmlNodeList ItemNodes =

xmlDoc.SelectNodes("/response/result/doc");

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

HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();

XmlDocument xmlDoc = new XmlDocument();

xmlDoc.Load(WebResp.GetResponseStream());

XmlNodeList ItemNodes =

xmlDoc.SelectNodes("/response/result/doc");

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

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);

}

}

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