Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 13-07-2009
Member
 
Join Date: Apr 2009
Posts: 22
How to make a Search Engine

I am a website builder I have made many small projects on building website's. Now one of my client wanted to add a search engine in his website... I only wanted to learn how to make search engine..???
Reply With Quote
  #2  
Old 13-07-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: how to make a search engine

The Following code shows the high-level SearchEngine class, which exposes properties such as ResultsPerPage, QueryText, and Highlight, and has a parameterless method called ExecuteQuery.

Code:
public class SearchEngine
{
    private static ISearchProvider _provider = null;

    static SearchEngine()
    {
        if (!string.IsNullOrEmpty(
            WebConfigurationManager.AppSettings["Search.Provider"]))
        {
            _provider = (ISearchProvider)
                Activator.CreateInstance(Type.GetType(
                    WebConfigurationManager.AppSettings[
                        "Search.Provider"]));
        }
        else _provider = new LiveSearchProvider();
    }

    public SearchEngine()
    {        
        if (!string.IsNullOrEmpty(WebConfigurationManager.AppSettings[
                "Search.ResultsPerPage"]))
            this.ResultsPerPage = Convert.ToInt32(
                WebConfigurationManager.AppSettings[
                    "Search.ResultsPerPage"]);

        if (!string.IsNullOrEmpty(
            WebConfigurationManager.AppSettings[
                "Search.Culture"]))
            this.Culture = WebConfigurationManager.AppSettings[
                "Search.Culture"];

        if (!string.IsNullOrEmpty(
            WebConfigurationManager.AppSettings[
                "Search.HighlightEnabled"]))
            this.Highlight = Convert.ToBoolean(
                WebConfigurationManager.AppSettings[
                    "Search.HighlightEnabled"]);
    }
    
    public string ProviderName
    {
        get { return _provider.GetType().Name; }
    }

    private int _resultsPerPage = 10;
    public int ResultsPerPage
    {
        get { return _resultsPerPage; }
        set { _resultsPerPage = value; }
    }

    private int _pageIndex = 0;
    public int PageIndex
    {
        get { return _pageIndex; } set { _pageIndex = value; }
    }

    private string _culture = "en-US";
    public string Culture
    {
        get { return _culture; } set { _culture = value; }
    }

    private string _queryText = "";
    public string QueryText
    {
        get { return _queryText; } set { _queryText = value; }
    }

    private bool _highlight = true;
    public bool Highlight
    {
        get { return _highlight; } set { _highlight = value; }
    }

    public SearchResults ExecuteQuery()
    {
        return _provider.ExecuteQuery(this.QueryText, 
            this.Culture, this.ResultsPerPage, 
            this.PageIndex, this.Highlight);
    }
}
Reply With Quote
  #3  
Old 13-07-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: how to make a search engine

I don't think you need to make the new one where if Google Search Engine (Worlds Largest & Best Search Engine) provides you for free. With Google Custom Search, you can harness the power of Google to create a customized search experience for your own website. Now see the features below :
  • Include one or more websites, or specific webpages

  • Host the search box and results on your own website

  • Customize the look and feel of the results to match your site

To Know More About it Visit : Google Search Engine
Reply With Quote
  #4  
Old 13-07-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: how to make a search engine

In my thinking Praetor has given you the best solution still if you require to make your own search engine, there are some similar threads made on Search Engine. I think Just Have a look at it if it gives an easy solution to it...!

Search Engine through PHP
Search Engine Optimization
What is Search Engine Optimization?
Need For Search Engine Optimization
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to make a Search Engine"
Thread Thread Starter Forum Replies Last Post
in. search-results as search engine instead of Google Eseld Networking & Security 5 15-07-2011 07:23 PM
How to make DNN website automatic login in Zoom Search Engine? Aarya Technology & Internet 5 20-08-2010 11:17 AM
No search results found for any sex related keyword searched on Microsoft Bing Search Engine Dinsh Technology & Internet 2 27-06-2009 01:15 PM
Reliance Communications launched Quick Search new search engine on mobile Gauresh India BroadBand 0 07-11-2008 02:15 PM
Search Engine through PHP SalVatore Software Development 5 19-09-2008 06:39 PM


All times are GMT +5.5. The time now is 01:16 AM.