Wednesday, July 23, 2008

the Attitude Part

One of my friends penned me these lines and I find it very true in every sense

The longer I live, the more I realize the impact of attitude on life.



It is more important that the past, than education, than money, than circumstances, than failures, than successes, than what other people think or say or do. It is more important than appearance, giftedness or skill.



The remarkable thing is - we have a choice every day of our lives regarding the attitude we embrace for that day.



We cannot change our past. We cannot change the fact that people will act in a certain way. We cannot change the inevitable.



The only thing we can do is play on the one string we have, and that is our attitude.



I’m convinced that life is 10% what happens to me and 90% how I react to it. And so it is with you.



We are in charge of our attitudes.



~ Charles Swindoll ~

Tuesday, July 22, 2008

rediff.com: Why Vinod Khosla is the smartest guy in Silicon Valley

rediff.com: Why Vinod Khosla is the smartest guy in Silicon Valley

Monday, July 14, 2008

Lucene Searching GuideLines

Searching Guidelines

Lucene allow searching and indexing simultaneously. However, an IndexReader only searches the index as of the "point in time" that it was opened. Either any updates to the index, added or deleted documents, will not be visible until the IndexReader is re-opened. Therefore, your application must periodically re-open its IndexReaders to see the latest updates. The IndexReader.isCurrent() method allows you to test whether any updates have occurred to the index since your IndexReader was opened.
Lucene supports wild card queries which allow you to perform searches such as book*, which will find documents containing termssuch as book, bookstore, booklet, etc. Lucene refers to this type of aquery as a 'prefix query'.

Lucene also supports wild card queries, which allow you to place a wild card in the middle of the query term. For instance, you could make searches like: mi*pelling. That will match both misspelling, which is the correct way to spell this word, as well as mispelling, which is a common spelling mistake.

Another wild card character that you can use is '?', a question mark. The ? will match a single character. This allows you to perform queries such as Bra?il. Such a query will match both Brasil and Brazil. Lucene refers to this type of a query as a 'wildcard query'.

Leading wildcards (e.g. *ook) are not supported by the QueryParser by default. As of Lucene 2.1, they can be enabled by calling QueryParser.setAllowLeadingWildcard (true ). Note that this can be an expensive operation: it requires scanning the list of tokens in the index in its entirety to look for those that match the pattern.

To restrict searches to only return results from a limited subset of documents in the index (e.g. for privacy reasons) The QueryFilter class is designed precisely for such cases.
Another way of doing it is the following: Just before calling IndexSearcher.search() add a clause to the query to exclude documents in categories not permitted for this search.

If you are restricting access with a prohibited term, and someone tries to require that term, then the prohibited restriction wins. If you are restricting access with a required term, and they try prohibiting that term, then they will get no documents in their search result.

As for deciding whether to use required or prohibited terms, if possible, you should choose the method that names the less frequent term. That will make queries faster.

Lucene Introduction

Lucene.Net is a source code, class-per-class, API-per-API and algorithmatic port of the Java Lucene search engine to the C# and .NET platform utilizing Microsoft .NET Framework.

Lucene.Net sticks to the APIs and classes used in the original Java implementation of Lucene. The API names as well as class names are preserved with the intention of giving Lucene.Net the look and feel of the C# language and the .NET Framework. For example, the method Hits.length() in the Java implementation now reads Hits.Length() in the C# port.
In addition to the APIs and classes port to C#, the algorithm of Java Lucene is ported to C# Lucene. This means an index created with Java Lucene is back-and-forth compatible with the C# Lucene; both at reading, writing and updating. In fact a Lucene index can be concurrently searched and updated using Java Lucene and C# Lucene processes.

Lucene.NET version 2.1 is available which is VS2005 compatible version.

Lucene Indexing