Tuesday, July 22, 2008

Search Using FAST Search API

FAST Enterprises Search API gives the interface to communicate with the ESP(Enterprises Search Platform) Admin.The following way we can do the search.


1. We need the ESP Admin server IP address/ Domain Name and Port Number.

EX : String host = "172.19.61.104";
String port = "15100";

2. Then Indentify the Collection where the data's resides.

EX : String viewName = "espsystemwebcluster";

Note :The Collection Should be create in ESP Admin bfeore run the program.

3. Create the Property file to create a seasrch Factory Instances.
EX :
Properties p = new Properties();
p.setProperty("com.fastsearch.esp.search.SearchFactory",
"com.fastsearch.esp.search.http.HttpSearchFactory");
p.setProperty("com.fastsearch.esp.search.http.qrservers", hostport);

ISearchFactory searchFactory = SearchFactory.newInstance(p);

Note :qrservers - A list of QRServers that you want to connect to.It's Mandatory Property.You can map multiple servers in the same type like "qrserver1.site.com:15100, qrserver2.site.com:15100".

HttpSearchFactory - It have Some other Optional Proerties.
RequestMethod -> "GET"/"POST" (Default : "GET")
CertiticateFile -> When Use the SSL Certificate
KeepAlive -> When use the Prsistance Connections is used.

4. Once the Search Factory Instances has been created,we can get the Views of the collection.Using this view Object ,we can do the search.

EX : ISearchView view = searchFactory.getSearchView(viewName);

5. FAST ESP API give the multiple of ypes of Search Option.You can set the option with the FAST Search Query.By default ESP have their own Query Language (FQL).

EX : String query = query.replaceAll("\"", "\\\"");
String fql = "string(\"" + query + "\", mode=simpleany)";

Mode - Specifies the search option.

6. Using IQuery interface we can create the FQL Query.

EX : IQuery theQuery = new Query(fql);

7. The Pass this query to view object ,it will return the Result set.

Ex : IQueryResult result = view.search(theQuery);

This Result Interface have all the documents which is related to your query.

FAST Introduction

FAST ESP is an integrated software application that provides a platform for searching and filtering services.It is a distributed system that enables information retrieval from any type of information. ESP combines real-time searching, advanced linguistics, and a variety of content access options into a modular, scalable
product suite.

FAST ESP does the following:

1. Retrieves or accepts content from web sites, file servers, application-specific content systems, and direct import via API
2. Transforms all content into an internal document representation
3. Analyzes and processes these documents to allow for enhanced relevancy
4. Indexes the documents and makes them searchable
5. Processes search queries against these documents
6. Applies algorithms or business rule-based ranking to the results
7. Presents the results along with the navigation options.

Monday, July 21, 2008

FAST - Search Engine

FAST is the leading global provider of enterprise search technologies and solutions that are behind the scenes at the world's best known companies. FAST's flexible and scalable enterprise search platform (FAST ESP) elevates the search capabilities of enterprise customers and connects people to the relevant information they seek regardless of medium. This drives revenues and reduces total cost of ownership by effectively leveraging IT infrastructure. FAST's solutions are used by more than 2,600 global customers and partners, including America Online (AOL), Cardinal Health, CareerBuilder.com, CIGNA, CNET, Dell, Factiva, Fidelity Investments, Findexa, IBM, Knight Ridder, LexisNexis, Overture, Rakuten, Reed Elsevier, Reuters, Sensis, Stellent, Tenet Healthcare, Thomas Industrial Networks, Thomson Scientific, T-Online, US Army, Virgilio (Telecom Italia), Vodafone, and Wanadoo.

FAST is headquartered in Norway and is publicly traded under the ticker symbol 'FAST' on the Oslo Stock Exchange. The FAST Group operates globally with presence in Europe, the United States, Asia Pacific, Australia, South America, and the Middle East.

In January, Microsoft made an accepted offer to acquire FAST for $1.2 billion.

FAST SEARCH - Home

Sealed Class

A Sealed is a modifer in .NET.The sealed modifier is equivalent to marking a class with the final keyword in Java.We can use this for the following reasons.

1. when youn want to provide security for the class.you declare sealed class.If you declare sealed class the class can not inerited to other class.
2. The sealed modifier is used to prevent derivation from a class. An error occurs if a sealed class is specified as the base class of another class. A sealed class cannot also be an abstract class.


using System;
sealed class SealedClass{
public int x;
public int y;
}

class MainClass{
static void Main(){
SealedClass sc = new SealedClass();
sc.x = 110;
sc.y = 150;
Console.WriteLine("x = {0}, y = {1}", sc.x, sc.y);
}
}


Output :
x = 110, y = 150

Sunday, July 20, 2008

Abstract Class

1. Abstract classes are classes that contain one or more abstract
methods.
2. An abstract method is a method that is declared, but contains
no implementation.
3. Abstract classes may not be instantiated, and require subclasses to
provide implementations for the abstract methods.


Let's look at an example of an abstract class, and an abstract method.

Suppose we were modeling the behavior of animals, by creating a class hierachy that started with a base class called Animal. Animals are capable of doing different things like flying, digging and walking, but there are some common operations as well like eating and sleeping. Some common operations are performed by all animals, but in a different way as well. When an operation is performed in a different way, it is a good candidate for an abstract method (forcing subclasses to provide a custom implementation). Let's look at a very primitive Animal base class, which defines an abstract method for making a sound (such as a dog barking, a cow mooing, or a pig oinking).

public abstract Animal
{
public void eat(Food food)
{
// do something with food....
}

public void sleep(int hours)
{
try
{
// 1000 milliseconds * 60 seconds * 60 minutes * hours
Thread.sleep ( 1000 * 60 * 60 * hours);
}
catch (InterruptedException ie) { /* ignore */ }
}

public abstract void makeNoise();
}


Note that the abstract keyword is used to denote both an abstract method, and an abstract class. Now, any animal that wants to be instantiated (like a dog or cow) must implement the makeNoise method - otherwise it is impossible to create an instance of that class. Let's look at a Dog and Cow subclass that extends the Animal class.

public Dog extends Animal
{
public void makeNoise() { System.out.println ("Bark! Bark!"); }
}

public Cow extends Animal
{
public void makeNoise() { System.out.println ("Moo! Moo!"); }
}

Now you may be wondering why not declare an abstract class as an interface, and have the Dog and Cow implement the interface. Sure you could - but you'd also need to implement the eat and sleep methods. By using abstract classes, you can inherit the implementation of other (non-abstract) methods. You can't do that with interfaces - an interface cannot provide any method implementations.