澳土及other .NET junkies, 请教string search

来源: CatcherInTheRye 2009-01-20 21:34:11 [] [旧帖] [给我悄悄话] 本文已被阅读: 次 (700 bytes)
If you have used the AJAX Toolkit AutoCompleteExtender, you know it queries a web service continueously as user is typing. Same as when you search on Google or Yahoo, it suggests kewords as you type. My question has nothing to do with, just give you a context.

How to make the server end string as fast as possible. Say I have 50,000 keywords that can be read from a static file into a generic List<> or any other collection type easily. What's the best way to implement the partial string match? say I want to start matching when user types in 2 characters. Doing List.Find() is too slow. Implementing a tree?

澳土, hope all the reading you do can help. Thanks dude.

所有跟帖: 

浅见啊~~ -LiYouCai- 给 LiYouCai 发送悄悄话 LiYouCai 的博客首页 (256 bytes) () 01/20/2009 postreply 22:06:02

兄台所见极是 -catcherintherye- 给 catcherintherye 发送悄悄话 (1195 bytes) () 01/20/2009 postreply 22:46:54

gotta be careful about the size of collection -澳洲老土- 给 澳洲老土 发送悄悄话 (208 bytes) () 01/21/2009 postreply 00:03:46

初步的想法.... -澳洲老土- 给 澳洲老土 发送悄悄话 (1191 bytes) () 01/20/2009 postreply 23:05:43

补充:solution 1可以用regular expresion,当然... -澳洲老土- 给 澳洲老土 发送悄悄话 (66 bytes) () 01/20/2009 postreply 23:15:58

For solution 2. read this..... -澳洲老土- 给 澳洲老土 发送悄悄话 (419 bytes) () 01/21/2009 postreply 00:15:36

Thanks a lot. You gave me some additional leads. -catcherintherye- 给 catcherintherye 发送悄悄话 (0 bytes) () 01/21/2009 postreply 14:44:10

请您先登陆,再发跟帖!

发现Adblock插件

如要继续浏览
请支持本站 请务必在本站关闭/移除任何Adblock

关闭Adblock后 请点击

请参考如何关闭Adblock/Adblock plus

安装Adblock plus用户请点击浏览器图标
选择“Disable on www.wenxuecity.com”

安装Adblock用户请点击图标
选择“don't run on pages on this domain”