house plans
Free Shipping on All House Plans!
Question or to order
Home >> Technology >> Article
Search entire site

Search Using ASP.Net and Lucene

Tags : , ,
Published On : 01-01-1753
Author : Steve Donegan

Getting Started

Getting Lucene to work on your website isn't hard but there are a few tricks that help. We decided to use the Lucene.Net 2.1.0 release because it made updating the Lucene index easier via a new method on the IndexWriter object called UpdateDocument. This method deletes the specified document and then adds the new copy into the index. You can't download the 2.1.0 binary. Instead you will need to download the source via their subversion repository and then compile it.

Don't worry this is an easy step. Using your subversion client - I recommend TortiseSvn get the source by doing a checkout from this url:

Next go into the directory: Lucene.Net_2_1_0\src\Lucene.Net You should find a Visual Studio solution file that matches your Visual Studio version. If you are using Visual Studio 2005 be sure to load Lucene.Net-2.1.0-VS2005.sln

Hit compile. The resulting Lucene.Net.dll in the bin/release folder is the dll you will need to reference in your Visual Studio project that will contain the Lucene code.

Creating the Lucene Index

Lucene creates a file based index that it uses to quickly return search results. We had to find a way to index all the pages in our system so that Lucene would have a way to search all of our content. In our case this includes all the articles, forum posts and of course house plans on the website. To make this happen we query our database, get back urls to all of our content and then send a webspider out to pull down the content from our site. That content is then parsed and fed to Lucene.

We developed three classes to make this all work. Most of the code is taken from examples or other kind souls who shared code. The first class, GeneralSearch.cs creates the index and provides the mechanism for searching it. The second class, HtmlDocument consists of code taken from Searcharoo a web spidering project written in C#. The HtmlDocument class handles parsing the html for us. Special thanks to Searcharoo for that code. I didn't want to write it. The last class is also borrowed from Searcharoo. It is called HtmlDownloader.cs and its task is to download pages from the site and then create a HtmlDocument from them.



User Tips and Info
House Plans
Be Careful With Page.PreviousPage
The Forums are Broken
Website Design, Simplify Things.
How to rank high on Google, Yahoo and MSN: Introduction
New Technology Section
House Plans, Lots of House Plans
House Plans
Apologies in advance
Thanks for coming
About a blog

Search House Plans

 1  2  3  4  5+
 1  1½  2  2½  3  3½  4+
Stories Garage Bays
 1  1½  2  1  2  3+
Square Feet
View Results
Enter Plan #:
Glossary of Terms
Understanding Blueprints
Understanding Copyright
What's included in a set of house plans?
Why pre-drawn house plans?
Plans with Indoor Basketball Courts
House Plans
Building a home plan with an indoor basketball court
House Plans
1. Building on slab vs. crawl space vs. basement? Advantages / disadvantage
House Plans
Garage Plans with Shops, Mother In-Law Suites, Apartments and Bonus Square Footage
House Plans
Luxurious Mountain Craftsman House Plans
House Plans
XML Encoding Problems - Hexadecimal Value 0x1A, is an Invalid Character
Beachfront, Coastal and Key West Home Plans
House Plans
The Finest Duplex, Town House, and Multi Unit Home Plans
House Plans
European and Luxury House Plans, Large and Small!
House Plans
The In-Law Suite Revolution
House Plans
A Frame House Plans A Home Builders Opinion Air Conditioning Tips Architecture beachfront house plans Beachfront Houseplans blueprints building log building lots building mistakes bungalow Bungalow House Plans Cape Cod House Plans celebrity home designs Christmas Coastal House Plans Color Photos Color Schemes Considerations for Building Foundations in a New House Plan Contemporary Style country house plans craftsman house plans Curb Appeal Custom vs Stock House Plans
Winter-Proof Your New House Plan: Let it Snow, Let it Snow, Let it Snow.
House Plans 101
Improving Your New House Plan’s Value
House Plans 101
Great Ideas for Decorating Your Home this Christmas
House Plans
Out with the Old and In with the New in Bathroom Designs
House Plans
Planning Future Upgrades to Your New Home Plan
House Plans 101
Built-in Storage Tips for Your New House Plan
House Plans
Make Your Thanksgiving Home Décor Fun and Fanciful
House Plans
Home Design Trends to Watch For in 2015
House Plans
The Right Appliances for your New Home Plan
House Plans 101
The Open Floor Plan: Stylish Living without Walls
House Plans
© 2014 The Plan Collection, LLC