Reputation:
I have a textbox and a button in one page.I want to enter a word in the textbox and click the button. After clicking the button I want to display the name of the web pages containing the word entered in the textbox. So please tell me how to do it? I am using C#.
Upvotes: 0
Views: 128
Reputation: 4595
So you want to create a search engine internal to your website. There are a couple of different options
A search engine in general exists out of (some of) the following parts:
These are non trivial things to create especially if you want a rich feature set like stemming (returning documents containing plural forms of search terms), highlighting results, indexing different document formats like pdf, rtf, html etc... so you want to use something already made for this purpose. This would only leave the task of connecting and orchestrating the different parts, writing the flow control logic.
You could use Lucene.net a opensource project with a lot of features. http://usoniandream.blogspot.com/2007/10/tutorial-implementing-lucenenet-search.html explains how to get started with it.
The other option is Microsoft indexing service which comes with windows but I would advice against it since it's difficult to tweak to work like you want and the results are sub-optimal in my opinion.
Upvotes: 2
Reputation: 1786
You are going to need some sort of backing store, and full text indexing. To the best of my knowledge, C# alone is not enough.
Upvotes: 0