<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>Brandon M. West</title>
	<atom:link href="http://brandonmwest.com/feed" rel="self" type="application/rss+xml" />
	<link>http://brandonmwest.com</link>
	<description></description>
	<lastBuildDate>Sun, 21 Mar 2010 15:12:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using a Vodacom/Vodafone 3G Card on Mac OS X</title>
		<link>http://brandonmwest.com/hardware/using-a-vodacomvodafone-3g-card-on-mac-os-x</link>
		<comments>http://brandonmwest.com/hardware/using-a-vodacomvodafone-3g-card-on-mac-os-x#comments</comments>
		<pubDate>Sun, 21 Mar 2010 15:12:16 +0000</pubDate>
		<dc:creator>Brandon West</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Wireless]]></category>
		<category><![CDATA[3g]]></category>
		<category><![CDATA[south africa]]></category>
		<category><![CDATA[vodacom]]></category>
		<category><![CDATA[vodafone]]></category>
		<guid isPermaLink="false">http://brandonmwest.com/?p=76</guid>
		<description><![CDATA[I'm in South Africa at the moment and my CDMA phone is useless here. I got a Huawei wireless USB modem from Vodacom to use, but for the first few days I had it I could only get it to work on my virtualized Windows machine. I finally managed to get it working by allowing [...]]]></description>
			<content:encoded><![CDATA[<p>I'm in South Africa at the moment and my CDMA phone is useless here. I got a Huawei wireless USB modem from Vodacom to use, but for the first few days I had it I could only get it to work on my virtualized Windows machine. I finally managed to get it working by allowing OS X to do the configuration and dialing rather than the Vodafone Mobile Connect software.</p>
<p><span id="more-76"></span>Here's how I managed it:</p>
<ul>
<li>Open the Network panel in System Preferences</li>
<li>Click the + symbol in the lower left to add a new interface and select the modem.</li>
<li>Go to Advanced options.</li>
<li>Select "Generic" for the Vendor and "GPRS (GSM/3g)" for the model. Enter "Internet" for the APN. This seems to matter, as I tried a few other strings and could not authenticate.</li>
<li>Enter *99***1# for the telephone number and save the configuration.</li>
</ul>
<p>To connect, you must first have the Vodafone Mobile Connect application installed, as there is no way that I found to enter the PIN via OS X. Plug in your modem, open Mobile Connect, and enter your pin. Then go back your network preferences, select the interface you've just configured, and click connect. If all goes well you should now be connected. I am not sure if this will work in locales other than South Africa; the phone number to connect may well be different.</p>
]]></content:encoded>
			<wfw:commentRss>http://brandonmwest.com/hardware/using-a-vodacomvodafone-3g-card-on-mac-os-x/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Posting a Lead to SugarCRM from Drupal via Webform</title>
		<link>http://brandonmwest.com/dev/posting-a-lead-to-sugarcrm-from-drupal-via-webform</link>
		<comments>http://brandonmwest.com/dev/posting-a-lead-to-sugarcrm-from-drupal-via-webform#comments</comments>
		<pubDate>Sun, 07 Feb 2010 00:33:19 +0000</pubDate>
		<dc:creator>Brandon West</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[sugarcrm]]></category>
		<category><![CDATA[webform]]></category>
		<guid isPermaLink="false">http://brandonmwest.com/?p=32</guid>
		<description><![CDATA[I was helping a friend solve the issue of capturing a lead to Sugar 5.2 from a form in Drupal 6 and my searching was not turning up a clear answer. This article was a good start but was a bit out of date and missing a couple steps. On the issues page for the [...]]]></description>
			<content:encoded><![CDATA[<p>I was helping a friend solve the issue of capturing a lead to Sugar 5.2 from a form in Drupal 6 and my searching was not turning up a clear answer. <a href="http://www.computerminds.co.uk/how-capture-sugarcrm-leads-drupal">This article</a> was a good start but was a bit out of date and missing a couple steps. On the <a href="http://drupal.org/node/287183">issues page</a> for the SugarCRM Drupal module, I found a couple other useful hints. This guide should work for Drupal 6 and SugarCRM 5.1+.<br />
<span id="more-32"></span><br />
First, download these Drupal modules: <a href="http://drupal.org/project/sugarwebform">SugarCRM Webform Integration</a> and <a href="http://drupal.org/project/webform">Webform</a>. Extract these archives to your server and <a href="http://drupal.org/getting-started/install-contrib/modules">activate the modules in Drupal</a>.</p>
<p>Create a new file named leadCapture_override.php in the root folder of your SugarCRM install on your server. Open the file and paste the following code:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># set up the array of usernames and hashed password<br />
</span><span style="color: #000088;">$users</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
<span style="color: #0000ff;">'Your_User_Name'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Your_User_Name'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pass'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Your_User_Hash'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'userid'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Your_User_Id'</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># identify the web site user by id so we can assign the lead to them<br />
</span><span style="color: #000088;">$assigned_user_id</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$users</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'user'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'userid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'assigned_user_id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'assigned_user_id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'assigned_user_id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$assigned_user_id</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># if we have an Opt-In field, we want to get rid of any Opt-Out field that we may have<br />
</span><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email_opt_in'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email_opt_out'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># convert opt out to an explicit binary boolean<br />
</span><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email_opt_out'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email_opt_out'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Now you will need to enter your configuration's user values In the $users array declaration (line 3 above). First enter the SugarCRM user name that will be assigned every lead coming from Drupal. Once you have the user name, replace Your_User_Name in the code above with it.</p>
<p>To get the userid and pass values, open your SugarCRM database with a database admin (such as phpMyAdmin) and run the following query: <strong>SELECT id, user_hash FROM users WHERE user_name='Your_User_Name'</strong>. Replace Your_User_Id with the id value, and Your_User_Hash with the user_hash value.</p>
<p>The next step is creating your webform. For the purposes of this article I am assuming that all the fields you need to capture are already setup in Sugar. If not, maybe <a href="http://vimeo.com/5194233">this screencast</a> can help. If you need any help creating the webform, more information can be found in the <a href="http://drupal.org/handbook/modules/webform">Drupal documentation</a>.</p>
<p>Once you have your webform created, you will see a SugarCRM Settings area on the webform configuration screen.<br />
<a href="http://brandonmwest.com/wp-content/uploads/Drupal_SugarCRM_settings.png"><img class="aligncenter size-full wp-image-62" title="Drupal SugarCRM settings" src="http://brandonmwest.com/wp-content/uploads/Drupal_SugarCRM_settings.png" alt="" /></a></p>
<p>In the <em>Sugar Form is posted to</em> field, enter <strong>http://yoursugarinstanceURL/index.php?entryPoint=leadCapture</strong>. <em>Lead Source</em> can be whatever you'd like. The <em>SugarCRM User</em> field <strong>must </strong>match the value you entered for Your_User_Name in the leadCapture_override.php file created earlier.</p>
<p style="text-align: left;">Congratulations, your Drupal form should now capture leads in Sugar.</p>
<p style="text-align: right;">Note: There is a rating embedded within this post, please visit this post to rate it.</p>
]]></content:encoded>
			<wfw:commentRss>http://brandonmwest.com/dev/posting-a-lead-to-sugarcrm-from-drupal-via-webform/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Indexing Legacy Data with NHibernate.Search</title>
		<link>http://brandonmwest.com/dev/indexing-legacy-data-with-nhibernate-search</link>
		<comments>http://brandonmwest.com/dev/indexing-legacy-data-with-nhibernate-search#comments</comments>
		<pubDate>Tue, 22 Dec 2009 00:36:52 +0000</pubDate>
		<dc:creator>Brandon West</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[lucene]]></category>
		<category><![CDATA[lucene.net]]></category>
		<category><![CDATA[nhibernate]]></category>
		<category><![CDATA[nhibernate.search]]></category>
		<category><![CDATA[nhsearch]]></category>
		<guid isPermaLink="false">http://brandonmwest.com/?p=8</guid>
		<description><![CDATA[While configuring NHibernate.Search, I ran into an issue while attempting to batch process a million or so legacy records. When I created the index directly from Lucene.Net, things were speedy and working as expected. When I created the index via NHibernate.Search, the indexer was generating way too many index files, numbering into the hundreds of [...]]]></description>
			<content:encoded><![CDATA[<p>While configuring NHibernate.Search, I ran into an issue while attempting to batch process a million or so legacy records. When I created the index directly from <a href="http://incubator.apache.org/lucene.net/">Lucene.Net</a>, things were speedy and working as expected. When I created the index via NHibernate.Search, the indexer was generating way too many index files, numbering into the hundreds of thousands. As a result, the number of file operations was increasing drastically with each iteration of the indexer, such that the FullTextSession.Index call would never finish.</p>
<p>I spent a long time messing about with different merge factors and max file parameters for Lucene.Net, but I was never able to make it work as I expected. The solution ended up being to force an optimize on the index after a certain number of records. Optimizing a Lucene index is analogous to defragging a harddrive; it orders and compacts the thousands of splintered .cfs files into one big file, thereby solving the problem of having to scan a growing number of files before each write.<br />
<span id="more-8"></span><br />
Here is my generic CreateIndex method that includes periodic optimization. This ended up solving the problem and allowed me to index 1.5 million legacy records in about 3 hours. This code depends on a specific finder implementation, as well as a generic method for optimizing an index, but it should be enough to get the idea across.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br /></div></td><td><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> CreateIndex<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span> batchSize<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
Type type <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=typeof+msdn.microsoft.com"><span style="color: #008000;">typeof</span></a><span style="color: #008000;">&#40;</span>T<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #008080; font-style: italic;">//Get the query object for the type to be indexed</span><br />
<span style="color: #6666cc; font-weight: bold;">object</span> finder <span style="color: #008000;">=</span> Find<span style="color: #008000;">.</span><span style="color: #0000FF;">Factory</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ResolveFinderFor</span><span style="color: #008000;">&#40;</span>type<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
var method <span style="color: #008000;">=</span> finder<span style="color: #008000;">.</span><span style="color: #0000FF;">GetType</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetMethod</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;get_All&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
var objectQuery <span style="color: #008000;">=</span> method<span style="color: #008000;">.</span><span style="color: #0000FF;">Invoke</span><span style="color: #008000;">&#40;</span>finder, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span> <span style="color: #0600FF; font-weight: bold;">as</span> IQueryable<span style="color: #008000;">;</span><br />
<br />
IFullTextSession fullTextSession <span style="color: #008000;">=</span><br />
Search<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateFullTextSession</span><span style="color: #008000;">&#40;</span>NH<span style="color: #008000;">.</span><span style="color: #0000FF;">CurrentSession</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
var total <span style="color: #008000;">=</span> objectQuery<span style="color: #008000;">.</span><span style="color: #0000FF;">Count</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
var iterations <span style="color: #008000;">=</span> total <span style="color: #008000;">/</span> batchSize<span style="color: #008000;">;</span><br />
<br />
<span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">int</span> optimizeThreshold <span style="color: #008000;">=</span> <span style="color: #FF0000;">10000</span><span style="color: #008000;">;</span><br />
var optimizeThresholdCounter <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #008080; font-style: italic;">//Find the generic optimize method</span><br />
MethodInfo optimizeMethod <span style="color: #008000;">=</span><br />
<a href="http://www.google.com/search?q=typeof+msdn.microsoft.com"><span style="color: #008000;">typeof</span></a><span style="color: #008000;">&#40;</span>IndexHelper<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetMethod</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;OptimizeIndex&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #008080; font-style: italic;">//Make it generic for the type in question</span><br />
MethodInfo genericOptimizeMethod <span style="color: #008000;">=</span><br />
optimizeMethod<span style="color: #008000;">.</span><span style="color: #0000FF;">MakeGenericMethod</span><span style="color: #008000;">&#40;</span>type<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #0600FF; font-weight: bold;">for</span> <span style="color: #008000;">&#40;</span>var i <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&amp;</span>lt<span style="color: #008000;">;</span> iterations<span style="color: #008000;">;</span> i<span style="color: #008000;">++</span><span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
var subset <span style="color: #008000;">=</span> objectQuery<span style="color: #008000;">.</span><span style="color: #0000FF;">Skip</span><span style="color: #008000;">&#40;</span>i <span style="color: #008000;">*</span> batchSize<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Take</span><span style="color: #008000;">&#40;</span>batchSize<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToList</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #6666cc; font-weight: bold;">int</span> startCount <span style="color: #008000;">=</span> <span style="color: #008000;">&#40;</span>i<span style="color: #008000;">*</span>batchSize<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #6666cc; font-weight: bold;">int</span> endCount <span style="color: #008000;">=</span> startCount <span style="color: #008000;">+</span> batchSize<span style="color: #008000;">;</span><br />
<br />
optimizeThresholdCounter <span style="color: #008000;">+=</span> batchSize<span style="color: #008000;">;</span><br />
<br />
var tx <span style="color: #008000;">=</span> fullTextSession<span style="color: #008000;">.</span><span style="color: #0000FF;">BeginTransaction</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>T instance <span style="color: #0600FF; font-weight: bold;">in</span> subset<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
fullTextSession<span style="color: #008000;">.</span><span style="color: #0000FF;">Index</span><span style="color: #008000;">&#40;</span>instance<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span><br />
tx<span style="color: #008000;">.</span><span style="color: #0000FF;">Commit</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
fullTextSession<span style="color: #008000;">.</span><span style="color: #0000FF;">Flush</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
fullTextSession<span style="color: #008000;">.</span><span style="color: #0000FF;">Clear</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #008080; font-style: italic;">//If we've hit the threshold, optimize</span><br />
<span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span>optimizeThreshold <span style="color: #008000;">!=</span> <span style="color: #FF0000;">0</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span><br />
optimizeThresholdCounter <span style="color: #008000;">&amp;</span>gt<span style="color: #008000;">;=</span> optimizeThreshold<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
genericOptimizeMethod<span style="color: #008000;">.</span><span style="color: #0000FF;">Invoke</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">null</span>, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
optimizeThresholdCounter <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span><br />
<br />
<span style="color: #008080; font-style: italic;">//optimize the index one final time</span><br />
genericOptimizeMethod<span style="color: #008000;">.</span><span style="color: #0000FF;">Invoke</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">null</span>, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></td></tr></tbody></table></div>
<p>I hope this saves someone some headaches - I know I wasted a lot of time finding this solution.</p>
<p style="text-align: right;">Note: There is a rating embedded within this post, please visit this post to rate it.</p>
]]></content:encoded>
			<wfw:commentRss>http://brandonmwest.com/dev/indexing-legacy-data-with-nhibernate-search/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
