Word press and shared hosting

I am sure many people loves wordpress and it is really really great blogging platform. Well this is more than the blogging platform as there are many professional websites running on the WordPress.

However I personally found this a bit tricky for me to customise or troubleshoot if things go wrong. My shared hosting provider is not too great and I have stopped bothering for any help or support from them (it is 1 and 1 by the way). Now I have started thinking about moving my blog to different platform and potentially in cloud.

Most probabily new platform would be python or nodejs.

Any thoughts about django or mezzanine would be highly appreciated.

Cheers, Sujit

Posted in hosting | Comments Off

Lalbaugcha Raja – Ganpati 2012

Thanks to the advance video streaming technology and social network, it become very easy to live stream any event. We have seen all olympics and paralymic games utilizing these technology where you do not need to stick with the TV. It is truily video on demand where people can watch events at their own convenience.

I am so glad to see streaming of Lalbaugcha Raja on YouTube, could not resist to put a link on my own blog.


Ganpati bappa, Morya…

Posted in Technology, Uncategorized | Comments Off

Windows 8 Developers Preview

Windows 8 Live Tiles

Windows 8 Live Tiles

Alright so next version of windows (windows8) is coming soon now. The moment I got the news that a developer preview of windows 8 is available for the download, I was very excited to see this running. I planned to download this and install in my ESXI infrastructure so that this could be tested/used optionally without making any physical machine a brick.

I first tried to install this directly in ESXI but no success. It gave me HAL INTIALIZATION ERROR, which turned out to be known issue reported by many of folks over the internet. Instead of spending time to do more research and try to understand the issue, I thought to install it on other virtualization system. VMware client gives different error stating something is missing and a long technical log.

I then thought to give Virtual Box a try. Since a long time, I was planning to try Virtual Box so this seemed to me a good opportunity to experience Virtual Box as well as Windows8.

Installation of Virtual Box was an easy task, got this downloaded from www.virtualbox.org. It has got installed on my new laptop without any issue or much to configure. Very easy and nice installation wizard I must say.

Once Virtual Box has been installed, new virtual machine wizard started.

New virtual machine wizardIn the next screen wizard asks for the operating system to be installed, I have selected windows 7 64 bit as the operating system as Windows8 was not there. I was assuming that if windows8 would be based on any other MS OS, it is more likely to be based on Windows7. My next choice was to select windows 2008 in case windows 7 options would not work.

After that virtual machine wizard asks for the memory to allocate. I have selected 1GB for it. These options are typically same as any other virtual machine creation either on the VMware infrastructure or MS Virtual machine infrastructure. I have not experienced Hyper V yet but assuming this would be same there as well.

You can expect typical configuration option while creating a virtual machine. Machine are machine regardless actual or virtual.

Next option was selection of a hard disk. This could be either a new hard disk which would be created by virtual box for you, or an Virtual Machine wizard, Hard Diskexisting hard disk could be located, if you have one created.

Virtual Box seems to support number of virtual disk formats. I am not sure whether hard drive created by other vm infrastructure could be used or not. I would cover this in another post to see compatibility between different VM infrastructures produced resources.

I have selected a new VM disk and selected VMDK option, I thought once VM is created this might be used in my ESXI by exporting there. I was wrong there. After installation of Windows 8 in a Virtual Box environment, I did try to export the machine to my ESXI infrastructure which was successful, however when open from ESXI HAL INITIALIZATION ERROR came back again. :(

You can choose size allocated to hard disk by specifying the actual size or choose for dynamic size option. Dynamic size option would allow disk to grow as and when extra space needed.

Once sizing is selected it shows summary screen to remind all the option selected, should you want to change anything, and it can be done before clicking the ‘Create’ button.

Summary page of Virtual Machine creation wizard

Click on ‘Create’ and your virtual machine is ready for OS installation. After this you would have to power on the newly created virtual machine from the Oracle Virtual Machine manager. After switching on the power of the machine, downloaded ISO of Windows 8 Developer Preview installation could be mounted to CD/DVD drive.

Once these steps are done, restart your virtual machine and setup files in the ISO will guide you for the installation of the Developer Preview. See steps carried out during installation of the OS.Installation StepsOnce the installation steps are done, System restarts few times (2 times I think), and License page gets displayed. After accepting the license it moves further to setup the system.

License Terms

License Terms - Windoes 8 Developer Preview

Most of the screens in the system gives same experience as Windows Phone 7. See the setting screen for configuring the Windows, all the options are presented in the same way as they are on the device.


Settings - Windows 8 Developers Preview

User Account

User Account - Windws 8 Developers Preview

After setting up the basic configuration in settings option, Windows asks for the credentials of a live account. Yes, it does asks for the credentials of a Live account which means this OS need to communicate with internet and access your profile. I am sure there would be options in the other flavour of this OS where you can create and manage local accounts, However for Developers Preview it does asks for the Live credentials.

I have uploaded a video to demonstrate installation of Windows 8 Developers Preview which could be found at “Windows 8 Developer Preview – First Look”.

These are all the steps you would need to start experiencing Windows 8 Developers Preview edition. I have not tested many of its options but it looks cool. I am sure that for rest of the weekend and next week I would be using this to explore further. It has Visual Studio 11 Express pre-installed. Expression Blend 5 is also pre-installed.


Home - Windows 8 Developers Preview

After using just for few minutes, I found new operating system (Windows 8) is a fun to use. User experience is very intuitive and layout is so cool.

I would also mention here that many things are provided considering the usages of apps these days. This looks like a practical Web based operating system which is connected with your live account. Many people who have prior experience of using windows phone 7 would get this very familiar. Many live tiles looks same as your windows phone7, however we know this is a full blown operating system for PC and Laptops.

I would not be surprised to get the news that very soon there would be many slick tablets coming with this OS.


Another thing which I noticed is that it looks very fast and responsive. I know there are not many things installed and running, however considering that it is running inside a virtual machine with limited and shared resources, performance is nice so far.

As always, I would appreciate your comments for the post till I would explore it further.

Posted in C#, Microsoft, Operating System, Silverlight, Technology, Uncategorized, Windows8 | Tagged , , , , , | 1 Comment

Private builds in TFS 2010 (aka Gated Check-in)

Build services are very improve in the TFS 2010. Apart from the many new features introduced in the build services, ‘Private Builds’ are something which is very practical solution for everyday development.

Many time when a developer has changed various classes and completed considerable amount of work, he/she would think to validate the build before checking in the changes. It is always nice to keep the source control in compilable state to avoid any impact on the team using the same source control.

Private build address this issue where a developer can shelve the changes in a shelve-set and queue a private build.

While queueing the private build, queue new build wizard would ask ‘What do you want to build?”. (see following screen shot to understand).

TFS Private buid

TFS Private buid

Either workspace item could be selected or second option ‘workspace item with shelveset’ could be selected.

In this case, TFS build controller will get the latest source code from the source control and additional it would also download changes from the shelve-set specified. This combination will be used to prepare a build.

There is another option while queueing a new build to select. “Check in changes after successful build”. If this option is selected, successful build will check-in the changes available in the shelve-set.

These types of build are not uncommon in developers. It is mostly a practice where a developer gets the latest source; update the changes and build to verify his/her changes does not break the build. CI builds also does the same thing however if build is broken because of a wrong check-in could still impact the whole team.

In case of private build it works prior to the actual check in and everything happens in isolation to the source control.

In order to ensure that private builds are copied to a separate area, drop location for the private build could be specified in the build process of the build definition.

Drop location of private build in build definition

Drop location of private build in build definition

Under the advance options there is an item as “Private Drop Location”, any build done as ‘Private build’ would be dropped in the specified location. This is useful if any particular test is needed with help of binaries.

After successful build, TFS publishes the outcome of the build validation to indicate whether shelve-set included in the build is fine. Build summary published by TFS Build gives information about validated shelve-set as well indicating that they have been checked in.


However, if build is failed due to either compilation or test failure. Changes indicated in the shelve-set will not be checked in. This is really something very nice to use TFS Build system as a quality gate to ensure all the changes going in the source control are in compile state and tested.


Private builds (Gated check-ins) are really a great feature of TFS2010. It helps you to achieve benefit of Test Driven Development. What we have been doing now is,

  • Write the test cases for each and every rule/requirement specified in the user story (use cases are broken into various small requirement called as user story).
  • Complete the development of user stories by developing the code which makes test cases pass.
  • Shelve all the test cases code and changes done in the code.
  • Request TFS Build to do a private build including the shelve-set.
  • TFS verifies and ensure changes in the shelve-set are in compile state and working as per the expectations set in test cases.
  • Changes checked in by TFS build using the comments and work item associated with shelve-set specified.

Even if there is any team not using TDD approach could utilize private builds in many scenario where there is concern as “Will my changes break the source code integrity?”.

There are some open source tools available which could help implementing a ‘Delayed Check-in’ process where developer could simply complete the development and shelve their changes. This tool will validate the changes and check in if they are valid.

Posted in Application Lifecycle Management, Technology, Uncategorized | Tagged , , , , | Comments Off

Silverlight hosting in WINFORM application

Introduction: Silverlight and windows based applications are totally different things. These not only run in separate processes but they are different in the nature also. Windows application runs in full trust mode and could access local resources. In other hand Silverlight applications are meant to be web based and they runs inside a web browser in isolation (sandbox environment).

Silverlight applications are becoming more popular everyday because of ease to develop and user experience. People more often consider developing a web component to be reuse in windows forms environment. It mostly considered as a good option for migration projects where a big enterprise system is migrated in phases.

Possible solution(s)

In order to host a Silverlight application within a windows form there are two options.

  1. Silverlight in Winform:Host web browser control in winform and communicate with Silverlight application.

While designing the Silverlight component or application, design everything carefully utilizing shared classes and linked classes concept of VS.net. It will help putting complex code in common classes to be referenced in a Silverlight and WPF based projects. WPF component could be easily hosted inside a typical winform application. Shared classes will be useful to ensure any change done from Silverlight perspective is not breaking WPF and vice-a-versa.

  1. WPF and Silverlight:Design the application in such a way that common components could be created in form of shared classes to help building a Silverlight and WPF specific control.

While designing the Silverlight component or application, design everything carefully utilizing shared classes and linked classes concept of VS.net. It will help putting complex code in common classes to be referenced in a Silverlight and WPF based projects. WPF component could be easily hosted inside a typical winform application. Shared classes will be useful to ensure any change done from Silverlight perspective is not breaking WPF and vice-a-versa.

There could be other ways of achieving this by separating the communication between two layers by implementing some protocol/process. An approach where windows application could pass information through server. (These will require additional round trip to server)

Option 2is more about planning the structure of the code and introducing a proper development processes specific to project’s need.

Option 1 is often seen as a quick win to host existing Silverlight application in a windows application.

Silverlight in Windows Application:

Following are the steps for accomplishing option 1 approach of solution.

  1. Within Silverlight application create a dedicated class to communicate with windows application and write all the logic there. Communication between Silverlight and Windows app is necessary to pass information, invoke the method and raise events etc. Let us name it WindowsClient.cs (in Silverlight project)
  2. Include reference of System.Windows.Browser namespace in the class and mark class as [ScriptableType] to expose the class in the web browser.
  3. Register this class and give a name to refer the class from web browser using scripting technique (javascript). If we want to call this class as WinClient, we can register it as HtmlPage.RegisterScriptableObject(“WinClient”, this); Now this class will be accessible from javascript and DOM through browser.
  4. We can create member functions to read from Silverlight and to pass information into Silverlight. Keep in mind that more simple work will leave less security loophole. Simple code will be easy to maintain as well. Make it a practice that information flow should be always from windows client to Read and Push information.
  5. Let us create a method to accept the information (serialized .net class containing any information to be used in Silverlight application). See following example and notice ScriptableMember attribute highlighted.

Public void SetInfomation(object serializedInfomation)
String message = serializedInformation.ToString();
//there is nothing to stop using a Serialization/DeSerialization wrapper to pack and //unpack information coming from win form application as following
// EventInformation evt = //CustomSerialization.DeserializeEntity<EventInformation>(message);
//now you have information in Silverlight layer so you can use it as per app’s need

  1. Another important thing is to raise some notification or event from Silverlight to notify windows host regarding change in the status. Such event could be session time out, validation error, information message etc. This could be achieved by writing a method to return string of serialized class from Silverlight. When windows client will get notification of any such event, it will read the Silverlight method to see detail and type of information.

Public string ReadInformationMessage()
String usefullInformation = CustomSerialization.SerializeEnttiy<SessionTimedOut>(App.mySessionObject);
Return usefullInformation;
//Point to notice here is that your POCO class being return could contain message, message //type (error, warning, information etc) and anything else
//windows host application should have a utility to transform these messages and execute //relevant code

  1. In windows application create a control to host Silverlight application. Add a web browser control in this custom control.
  2. Declare a private variable to contain Silverlight application URL.
  3. Modify the constructer to accept Silverlight application URL. (Alternatively there could be a public method created to inject the URL and force browser to navigate).
  4. Write the code to navigate browser control to the given URL. Make sure you have registered event handlers of web browser control to handle DocumenCompleted and StatusTextChanged. In order to avoid HTML dialogs appearing to display and script error make webBrowserControl.ScriptErrorsSuppressed = true.
  5. In the DocumentCompleted event handler check and ensure whether document is loaded and then push your information (serialized entity) into Silverlight by using javascript. Javascript method could be invoked as following example.

String strToBePassed = YourSerializationUtil.Serialze<YourObject>(obj);
object[] script = { “JSMethodSetInformation(‘” + strToBePassed + “‘);” };
webHost.Document.InvokeScript(“eval”, script);

Alternatively you can directly call you javascript method without using Eval by passing array of object as argument.

  1. In the head section of the html page (or aspx page) writes following code to initialize Silverlight object reference. See example below:

<script type=”text/javascript”>
var slCtl = null;
function initializePlugin(sender, args) {
slCtl = sender.getHost();

  1. Call above mentioned method using Silverlight plugin’s param tag as following:

<object id=”slShell” data=”data:application/x-silverlight-2,” type=”application/x-silverlight-2″ width=”100%” height=”100%”>
<%– <param name=”Windowless” value=”true”/>–%>
<param name=”source” value=”ClientBin/ShellModule.xap”/>
<param name=”onError” value=”onSilverlightError” />
<param name=”background” value=”white” />
<param name=”minRuntimeVersion” value=”3.0.40624.0″ />
<param name=”autoUpgrade” value=”true” />
<param name=”onLoad” value=”initializePlugin” />
<a href=”http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0″ style=”text-decoration:none”>
<img src=”http://go.microsoft.com/fwlink/?LinkId=108181″ alt=”Get Microsoft Silverlight” style=”border-style:none”/>

In this example, whole object block is given to help understanding usages of Param tag.

  1. Now define Javscript version of methods to be called from winform application and invoke Silverlight method.

<script type=”text/javascript”>
function SetSessionInformation(value)
if (slCtl != null)
if (slCtl.Content != null)

function GetInformation(value) {
if (slCtl != null)
if (slCtl.Content != null)
value = slCtl.Content. WinClient.GetInformation();
return value;

  1. In the above mentioned example it is assumed that there would be two public methods available in Silverlight’s class as scriptable member with name of SetInformation and GetInformation to push and pull the information.
  2. Another interesting thing is to notify the windows application about any event in Silverlight layer. In Silverlight if there is any event occurred such as Session time out following code could be used to change the status of web browser control.

HtmlPage.Window.SetProperty(“status”, “Silverlight Status Changed”);

  1. Changing the status message will trigger web browser’s event registered in windows form control (StatusTextChanged). Windows form class than read the Silverlight information as per status changed notification and execute the appropriate code.

Further Suggestions:

These steps are just proof of concept to give a high level view for achieving Silverlight applications within the windows application. As per any existing architecture or guidelines this approach could be extended to fit in the requirement.

It is highly recommended to place these units totally separate to any other part of the application to avoid making these as a dependency of other part of the system. Specific classes could be developed to carry application specific information such as state of business entity, actions, messages (error, warning, information) etc.

It is suggested to encrypt the message while passing between these applications to avoid any data security implications. For general applications standard Base64 encryption would be sufficient, however depending on the data sensitiveness any complex logic could be implemented while serialization process.

Posted in Silverlight | Tagged , , | 2 Comments

Sketchflow for mockup

Last week I used SketchFlow feature of Expression Blend to make a prototype of our next project. I was surprised to see flexibility in the tool. Creating prototype screens are so easy that within few hours we have our prototype ready and publish to stake holders for their review.

Few usefull screenshots and tips will be shared soon, however I must say that this tool looks promising and quite helpful. There is a functionality of creating sample data to bind with lists, grids and any other control.

Create the sample data as per the business entities and bind it with controls.

Phew, screen is ready.

There is another great feature to create map between the screens. Just click one screen and connect to other. When the prototype is being played in the SketchFlow player it will have navigation feature as per the map. Very easy to provide navigational flow.

In today’s scenario where we have everyday change in the requirement these kind of tools are very helpful to build common understanding within the team.

Create the prototype, publish to team and get their feedback.

Feedback option is also quite helpful for revieweres as well as developer/designers to incorporate it.

And the best part, all these screens could be used during development of the application as a base line. Means there is no duplicate effort.

Please keep visiting this space for detailed information about this tool..

Posted in Uncategorized | Comments Off

Good to great – Really great

I was never a book lover or good reader of books. I always wonder to hear how people are passionate about books and that is not only for fiction, thriller etc but Management, Leadership, Philosophy etc.

I am very thankful to Prism Club initiative of Mastek which gives me opportunity to start reading again.

Again, because I was a good reader of Hindi Novels written by Vedprakash Sharma, Surendra Mohan Pathak. There was time when I read all the novel by Mr. Pathak and Mr. Sharma.

Once I started my professional journey, neither I got some time nor any opportunity to buy such book to read. In my opinion, any book whether it is a novel or story or anything it gives lot of knowledge. Sometime you realize about what you are gaining and sometime not. I learned all my literature and ‘hindi’ skills from novels.

I even learned lots of english from emails sent to me by various people, from internet based articles, blogs etc.

The moment I started reading ‘Imaginging India’ by Mr. Nilekani, I realized that the reader inside me gets excited to learn things while reading. I started loving reading.
Next book ‘Good to great’ might not be great book by critics or many other great peoples, but for me this is being proved to be a really ‘great’ book. Sometime I found there are many things of my own experience and findings are explained in the book.

This is really a great book and I would suggest reading this every person who is going to work in any organisation.

Believe me, this will give you what you are looking for. Every time you read this book you will get another view of things going on around.

Posted in Uncategorized | Comments Off

Lucene the search engine

Organization of the information in different categories and accessing them quickly is always interesting subject. We always keep storing useful information in database, documents, and other different storage medium.

Now when we have cheaper storage device and lots of sources for information everyday it becomes difficult to organize the data and access them as and when required.

All of the IT Systems are based on information collected over the period of time. To access such large data spread in different form of storage medium such as documents, database, texts stored in database. Faster searching the required information was always a challenge for IT professionals.

Full text search is one of the favorite techniques for Architects for searching text. There are many example of it. Most of the search engines are based on full text searching. Some time it is called as Free Text searching because user don’t need to type their queries in particular structured manner.

There are many Full Text Solutions available in the market from almost all major software vendors. Microsoft Index server, Oracle Text, Sql Server, Microsoft Lookout are few of the full text searching solution.

Lucene is open source indexing and searching solution supported by Apache Software Foundation using Java as the programming language. First version of Lucene (0.01) was released in March 2000 (8 years ago) from the SourceForge. First apache Jakarta release was released in June 2002 (version 1.2).

Lucene is a high performance and scalable information retrieval open source framework. This is being used by many famous organizations for their search solution. Microsoft Lookout is also based on Lucene.net (.net port of Lucene).

Some of the organizations which use Lucene are following:
o Encyclopedia Britannica
o FedEx
o Mayo Clinic
o Hewlet Packard
o Midgard
o LendingClub.com
o Wikipedia, MediaWiki, Joost, ISOHunt and many more…

Lucene was initiated by Doug Cutting, the creator of first open source World Wide Web search engine (www.nutch.org). Initially this was developed in Java and later it is ported to different programming languages as well.

Since all language port of Lucene uses same algorithm of creating index, index created by Lucene (Java) could be used by lucene.net or its port to C, Python, and Ruby etc.

It is very surprising to know that many oracle DBA and users wrote in different forums that Lucene works well than Oracle Text for them. There is another open source initiative is going on for Lucene support inside Oracle JVM as OJVMDirectory.

As oracle supports java and has got built in JVM in oracle database entire Lucene can be deployed inside oracle using loadjava utility.

I have not got opportunity to work with OJVMDirecotry initiative but it sounds very interesting. Lucene hosted inside oracle and you can build Lucene based indexes on the tables and later on these indexes can be used with combination of other Sql or pl/Sql code. J

Getting started with Lucene

For using Lucene in the application we have to first build index by using different classes and APIs. All samples give here are based on Lucene.net (dot net port of Lucene).

Creating Lucene index is quite easy and there are many options to build customized index as per the requirement.

Following is the example of creating and using Lucene index for Addresses table of a database. In a particular scenario where addresses table has millions of records, it is very difficult to search a particular address in it. There is a text field in the table to store the address (combination of street, house number, house name, city, post code, town and any other attribute of an address).
For example following are the same address written in different format:

1, Street, House Name, Near Xyz, City, Town, Country, Postcode,
1, House name, near XYZ City, Street, Town, City, country, Postcode

And may be incomplete information
1, House Name, Street, Town, Postcode

For all of the above scenarios searching the exact address from the millions of the record is quite difficult.

Following example build index for Addresses in the database for its Address and address id field.

Building the Lucene index from database table

Listing 1 this is assumed that a dataset is populated with the result

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data;
using Oracle.DataAccess.Client;
using Lucene.Net.Index;
using Lucene.Net.Analysis;
using Lucene.Net.Documents;
using Lucene.Net.Store;
using System.Xml;

namespace CCSDbIndexer
public class Program

public static void Main(string[] args)

//parse the command line arguments



private static void index()
FileInfo indexLocation = new FileInfo(Path.Combine(Environment.CurrentDirectory, “Index”));

IndexWriter writer =
new IndexWriter(indexLocation, new Lucene.Net.Analysis.Standard.StandardAnalyzer(), true);



Oracle.DataAccess.Client.OracleConnection con = new Oracle.DataAccess.Client.OracleConnection(connectionString);

DataSet ds = getDataset(…);

while (rowReturned(ds))
//index the rows…
indexDataset(ds, writer);
ds = getDataset(…);



Note: This is a very small example of building lucene index from a dataset. There are many API (public classes and methods) available to be used to control the building of index. SetMergeFactor, SetMaxBufferedDocs, SetMaxMergeDocs are some of the instance method of IndexWriter class which is can be manipulated for faster indexing of the documents. As we know that there is always trade off in hardware and performance. So if you put more RAM and use multiple processor you can use all of the resource for building large indexes.

private static void indexDataset(DataSet ds, IndexWriter writer)

foreach (DataTable dt in ds.Tables)
DataColumnCollection columns = dt.Columns;

foreach (DataRow row in dt.Rows)
Document doc = new Document();
foreach (DataColumn col in columns)
//check whether field is avialable in our collection

if (fieldAttribute.Count > 0)
if (fieldAttribute.ContainsKey(col.ColumnName.ToUpper()))
IndexFieldProperty field = fieldAttribute[col.ColumnName.ToUpper()];

doc.Add(new Field(field.fieldName, row[col.ColumnName].ToString(), Field.Store.YES, (field.canTokenized) ? Field.Index.TOKENIZED : Field.Index.UN_TOKENIZED));
if (doc.GetFieldsCount() > 0)


Note: Have you noticed different parameters of the Field constructor? These are attributes of a field in a Document (Lucene Document) collection of documents formed a lucene index. By specifying the different attribute of Field we can tell lucene framework to store the information in different ways. For example we may want to tokenise a big string or we want to store the entire string as a single field. We can use different Analyser which are useful for handling punctuations, number or language specific words… etc.

Searching the Lucene index

Searching the information from Lucene index is very easy. There are various options available to get the result using the filter criteria, sorting etc. There are different analyzers available to be used with and one can write a custom analyzer for specific language or need.

Listing 2 Searching the Addresses from Lucene Index

Public static Addresses SearchAddresses()

Lucene.Net.Index.IndexReader reader = Lucene.Net.Index.IndexReader.Open(addressIndexFolder());

Lucene.Net.Search.Searcher searcher = new Lucene.Net.Search.IndexSearcher(reader);
Lucene.Net.Analysis.Analyzer analyser = new Lucene.Net.Analysis.Standard.StandardAnalyzer();

//create a query parser by specifying the field name…
Lucene.Net.QueryParsers.QueryParser parser = new Lucene.Net.QueryParsers.QueryParser(“OneLineAddress”, analyser);

Lucene.Net.Search.Query query = parser.Parse(searchString);

Lucene.Net.Search.Hits hits = searcher.Search(query, Lucene.Net.Search.Sort.RELEVANCE);

int total = hits.Length();
total = (total < 50) ? total : 50;
//collection of address
Addresses addressSummary = new Addresses();

for (int i = 0; i < total; i++)
Lucene.Net.Documents.Document doc = hits.Doc(i);
Address summary = new Address();
Summary.AdressID = (doc.Get(“AddressId”);
Summary.OneLineAddress = doc.Get(“OneLineAddress”);

return Addresses;

Note: Similar to indexing there are various methods available to control the search behavior. We can use different analyzers to for treating punctuation, white spaces, numbers etc differently. There are various options available with Searcher class to get the searched result in specific order.


Lucene is a very powerful and robust search framework which is being used by many organizations since years. There are many language ports available to be used.

In a scenario where it becomes very difficult to provide a cost effective and robust search solution to search and match the records on the basis of percentage match of different textual information, Lucene helps a lot and also appreciated by everyone.

Performance is tremendous and I must say that if you like google style search and index solution for your enterprise, Try Lucene. And no wonder if you will love using and recommending it.

There are various website, search engines and applications which are already using Lucene underneath. This is very useful tool/framework for building enterprise application with index and search capabilities, document management system, information repository system, Mobile application (please note size of entire Lucene.net assembly after compilation form is less than 300 KB).

8. References

Jakarta Apache site: http://lucene.apache.org/

Wikipedia: http://en.wikipedia.org/wiki/Lucene/

Free Search blog: www.lucene.com

Lucene.net: http://incubator.apache.org/Lucene.net

Marcelo Ochoa’s Blog:http://marceloochoa.blogspot.com/2007/09/turbocharge-your-oracle-jvm.html (Lucene domain index in oracle)

Lucene in action : http://www.manning.com/hatcher2/ (ISBN: 1932394281).

There are loads of materials available for the topic if you search in any popular search engine.

Posted in C#, Technology | Tagged , , | Comments Off