简体   繁体   中英

Implementing a fast and relevant search for my site (C# ASP.net)

My site has a database of widgets, each widget has a name and description. I want to implement a fast and relevant search system on my site, how do I do this?

As a side note, I also implemented tags on those widget. Here is how I implemented (Tell me what you think):

Table widgets: has unique id plus other info for a widget Table tag_words: Has unique ID and of course, the tag Table tag-widget: Join table that associates a tag to a widget

I've created indexes on both all those columns to make search as fast as possible.

If you're using SQL Server, you can utilize full-text search . As for the tags, that's the best way for a small to medium site. StackOverflow denormalizes the tagging for faster reads, but for your app I would probably avoid that.

Lucene.NET is an alternative if you can't use the built-in full-text search from your database. It also gives you better control over what and how things are indexed.

Reading your side note about tags, I think I would really use Lucene.NET. It will give allow you to decide how to rank the tags in relation to everything else whereas I don't know if that is possible with SQL Server's full text search.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM