Create search engine for site in asp .net c#

拈花ヽ惹草 提交于 2019-12-11 06:29:21

问题


Newbie alert!

ASP .net | C# | VS2008 | MS SQL server 2008 R2 Express

I have a database with file names, file paths and file category. I have lots of static pages in the website also. I want to develop a custom search engine (since I am not allowed to use other 3rd party tools - basically they want me to reinvent the wheel).

When the user searches for something, it should search the file names and also the content of the static pages. File names can be searched straightforward from the database(did it). The static pages are SEO friendly with headers,etc.

How do I go about indexing the static pages in the website? How to create the search index after some pages are added in future? Are there functions like curl in php that can be used in ASP.net C#?

Also I heard about full text search. Any links on how to query the full text database?

P.S: Newbie :)


回答1:


If you are sure your pages won't change at all in near future, look up SQL full text indexing, which should serve most purposes. But if you need to scale up going forward.You should look at Apache Solr (built using Lucene) - it offers a RESTful interface for integrating into .NET or whatever platform you prefer. It offers all the goodies could ask for such as faceting without concern for compatibility Java, .NET versions etc.

You can easily integrate Solr into your .NET app using 1




回答2:


You need not to use cURL for pHP. Just use the IO functions to manipulate the list of files in the directory (web) and get their content and store them in the database for future search. From the text you can retrieve the page title, meta tags too with Regular expressions.

Let me know if you need code for this if the logic suitable for you.



来源:https://stackoverflow.com/questions/5878914/create-search-engine-for-site-in-asp-net-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!