Adsence750x90

Thursday, November 13, 2008

Creating Search Engine with C# and ASP.NET using Yahoo API - Build your Own Search Service (BOSS)

how to create a search engine? i search about the topic in google.i cant get useful results. finally i foound YAHOO API for making ower own Search engine,that is BOSS (Build your Own Search Service) is Yahoo!'s open search web services platform. you can read more about this topic from Yahoo, Build your Own Search Engine. Yahoo provide SDK for search engine.you can download from yahoo developer.
This SDK includes code in the following languages:

* ColdFusion
* C#
* Flash/Flex (ActionScript)
* Java
* JavaScript
* Lua
* Perl
* PHP
* Python
* Ruby
* VB.NET
* Widgets (JavaScript + XML)

ASP.NET and C# programmers can easliy create Search Engine with Yahoo.ASP.dll file.
for Web search call Yahoo.API
sample C# code from Yahoo.API

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Yahoo.API;
using System.Xml;
using System.IO;
public partial class Search : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void btnWebSearch_Click(object sender, EventArgs e)
{
YahooSearchService yahoo = new YahooSearchService();

Yahoo.API.WebSearchResponse.ResultSet resultSet = yahoo.WebSearch("YahooExample", TextBox1.Text, "all",10, 11, "any", true, true, "en");

StringWriter sw = new StringWriter();
foreach (Yahoo.API.WebSearchResponse.ResultType result in resultSet.Result)
{
sw.WriteLine("Title: {0}", result.Title);
sw.WriteLine("Summary: {0}", result.Summary);
sw.WriteLine("URL: {0}", result.Url);
sw.WriteLine("============================================");
}
Response.Write(sw.ToString());
}
}

2 comments:

asma si bulat said...

hello :

i need your help..i'm student for the last semester.. i need to complete my final year project. for my final year project i need to do search engine using asp.net and c# but now i'm still have problem to do it..i do know where and how to start. can you help me.at least you show the step to do that..i really really need your help..tq

Raju.M said...

I already mentioned the API link on my post. you can get samples and documentation from http://developer.yahoo.com/search/boss/boss_api_guide/ .
please go and check it.