Tue, 28 Dec 2010 23:12:00 GMTWith over 10 million hits a day, funda.nl is probably the largest ASP.NET website which uses Solr on a Windows platform. While all our data (i.e. real estate properties) is stored in SQL Server, we're using Solr 1.4.1 to return the faceted search results as fast as we can. And yes, Solr is very fast. We did do some heavy stress testing on our Solr server, which allowed us to do over 1,000 req/sec on a single 64-bits Solr instance; and that's including converting search-url's to Solr http-queries and deserializing Solr's result-XML back to .NET objects! Let me tell you about faceted search and how to integrate Solr in a .NET/Windows environment. I'll bet it's easier than you think :-) What is faceted search? Faceted search is the clustering of search results into categories, allowing users to drill into search results. By showing the number of hits for each facet category, users can easily see how many results match that category. If you're still a bit confused, this example from CNET explains it all: The SQL solution for faceted search Our ("pre-Solr") solution for faceted search was done by adding a lot of redundant columns to our SQL tables and doing a COUNT(...) for each of those columns: So if a user was searching for real estate properties in the city 'Amsterdam', our facet-query would be something like: SELECT COUNT(hasGarden), COUNT(yearBuilt1930_1940), COUNT(yearBuilt1941_1950), COUNT(etc...) FROM Houses WHERE city = 'Amsterdam' While this solution worked fine for a couple of years, it wasn't very easy for developers to add new facets. And also, performing COUNT's on all matched rows only performs well if you have a limited amount of rows in a table (i.e. less than a million rows). Enter Solr "Solr is an open source enterprise search server based on the Lucene Java search library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching, replication, and a web administration interface." (quoted from Wikipedia's page on Solr) Solr isn't a database, it's more like a big index. Every time you upload data to Solr, it will analyze the data and create an inverted index from it (like the index-pages of a book). This way Solr can lookup data very quickly. To explain the inner workings of Solr is beyond the scope of this post, but if you want to learn more, please visit the Solr Wiki pages. Getting faceted search results from Solr is very easy; first let me show you how to send a http-query to Solr: http://localhost:8983/solr/select?q=city:Amsterdam This will return an XML document containing the search results (in this example only three houses in the city of Amsterdam):
Fri, 10 Feb 2006 09:03:00 GMT
Add this template to your VS2005 VWD ProjectTemplates folder (or just unzip it somewhere and open it with Visual Web Developer). The Visual Web Developer C#-ProjectTemplates folder is default located in \My Documents\Visual Studio 2005\Templates\ProjectTemplates\Visual Web Developer\CSharp.
Note that I've created this weblog example-application in only 4 hours(!), and it contains not a single line of code.
Yep, that's right: 0 lines of code!!! I accomplished this by using:
Features of this QuickBlog webapplication:
Visitor writing a comment:
After logging on, the admin can manage postings and comments (or create a new posting):
Fri, 09 Dec 2005 11:02:00 GMT
And you also want to keep using the ASP.NET server-side programming model?
Then open-source MagicAjax.NET is the right solution for you!
MagicAjax is easily integrated in your ASP.NET 1.1 and 2.0 webapplications:
That's all you need to do! The MagicAjax framework takes care all of the intrinsic details for you.
We've put together a few example pages to show the power of MagicAjax.NET. See the online demo on http://demo2.magicajax.net/ (note that the server is sometimes very slow):
You can view the sources of all demo pages online, so you can see for yourself how easy it is to use MagicAjax.
Tip: Also have a look at these MagicAjax demo's using FireFox. Fully supported!
Next you see a screenshot of the WebPart Framework in ASP.NET 2.0 using MagicAjax.NET.
Moving, adding and removing of WebParts is all done without a single visual postback; the WebParts just appear on your page!
Mon, 03 Oct 2005 20:51:00 GMT
An good example (e.g. used by Michael Schwarz for demonstrating Ajax.NET) is the case where the master dropdown shows a list of car brands, and the detail dropdown shows a list of available models for the selected brand. When the user selects a car brand, the car model dropdown is filled clientside, so no need for a postback to the webserver!
I've assembled an example project containing 4 techniques for implementing Master-Detail dropdowns in ASP.NET, which you can download here (including source code!!!). The 4 techniques in my example project are:
Note: For these examples to work, you need ASP.NET 2.0 beta 2 installed. For the examples to run on RC, some changes have to be made for the Client Script Callback example.
Note2: Thanks to Bertrand Le Roy for helping me out on the Atlas code!
A few things I haven't solved for the Atlas example yet:
Please give me feedback when you think my Atlas example could be improved.
Wed, 20 Jul 2005 00:21:00 GMT
As you may or may not know, the current beta 2 version of Visual Studio 2005 Team System only supports manual team builds against the Team Foundation server. I think the final release of VSTS is going to support scheduled builds (e.g. nightly builds), but I don't think continuous integration will be supported (because Microsoft don't practice CI themselves).
However my company enforces their developers to use Continuous Integration on all projects, so I had to build a CI process for Team System myself.
I thought it was a good idea to share the results with you :)
I enabled continuous integration by setting up a scheduled MSBuild project that runs every 5 minutes. It includes 4 custom MSBuild Tasks I've created (also see Visio drawing at the bottom):
Because you're all such nice people, I decided to share my code and binaries. Download it here.
To run this Continuous Integration process on your own server, take the following steps:
Thu, 23 Jun 2005 20:47:00 GMTHave a look at this HTML snippet. When clicking the 'clickme' innerText of div2, I expect the browser to alert "div2", because div2 is the first child of its parent, div1.
I've tested this HTML snippet on both IE and FireFox, and guess what?
IE reacts as expected by alerting "div2".
However, FireFox alerts "undefined"....?
Apparently, in FireFox div2 is considered to be the second childNode of div1; not the first. I guess this is because FireFox parses the whitespace between div1 and div2 as being a seperate node! BUT WHY????
[Note: of course I can let IE and FF return the same results by removing all whitespace between the div1 and div2 tags, but that would result in human-unreadable and hard to maintain Html.]
I've received a lot of comments about the fact that FireFox precisely (I'd say 'rigidly') follows the w3c DOM recommendation on this. I'm aware of the w3c specs, but I still think it sucks having to write seperate code for IE and FF (or include a library of wrapper functions).
Personally, I think the IE dom-representation is the more sensible one, whether it's in the recommendation or not.
And FireFox just made a very bad 'first impression' to me :(
Read these links on more information why Mozilla has chosen to preserve whitespaces in the DOM: